https://github.com/mackee/shellcut
The command like cut(1) on the basis of shellwords
https://github.com/mackee/shellcut
Last synced: about 1 year ago
JSON representation
The command like cut(1) on the basis of shellwords
- Host: GitHub
- URL: https://github.com/mackee/shellcut
- Owner: mackee
- License: mit
- Created: 2020-04-13T09:17:57.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-13T11:37:18.000Z (about 6 years ago)
- Last Synced: 2025-06-20T06:57:13.832Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shellcut
The command like cut(1) on the basis of shellwords.
## Motivation
* Find rows from access logs of load balancers
* That logs separated values by spaces but also has quoted values too
## Installation
```console
$ go get github.com/mackee/shellcut
```
## Usage
```console
$ cat access_logs.txt | shellcut -f 1-10 -g 1=h2
```
* `-f` - indices on a field for output. 1-origin.
* `-f 1,2,3` output first to third field on row
* `-f 1-10` output first to 10th field on row
* `-f -` print all fields
* `-g` - filter row by field value
* `-g 10=foobar` output matched rows that 10th field is foobar
## See also
* [mattn/go-shellwords](https://github.com/mattn/go-shellwords)