2

I want to know if it is possible with the cut option to indicate the delimiter with a line break "\n" or "\t".

Ex: cut -f 1 -d "\t". This line gives me error.

muru
  • 207,228

1 Answers1

3

Unlike with e.g. tr, you cannot pass \t or \n directly to cut. You need ANSI-C quoting style.

You can use $'\n' or $'\t' as delimiter.
Note, that tab is the default delimiter for cut, so you can omit setting the delimiter.

jwodder
  • 916
pLumo
  • 27,991