Is it possible to use a string as a delimiter in unix cut command? Is it possible to use a string as a delimiter in unix cut command? unix unix

Is it possible to use a string as a delimiter in unix cut command?


Try using this.

$grep abc.pl * | awk -F 'abc.pl' '{print $2}'

-F fs--field-separator fs Use fs for the input field separator (the value of the FS predefined variable).


When I read man for cut it states ... delim can be a multi-byte character.

Multi-byte, but just one character, not a string.

canti:~$ ll | cut --delimiter="delim" -f 1,2cut: the delimiter must be a single characterTry `cut --help' for more information.canti:~$ cut --version  cut (GNU coreutils) 5.97

You can specify only output delimiter as a string (useless in this case):

 --output-delimiter=STRING                                                                  use STRING as the output delimiter the default is to use the input delimiter


why not use grep abc.pl | awk '{print $3, $4}'?