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
  • 193,181
  • 53
  • 473
  • 722

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
  • 727
  • 2
  • 7
  • 12
pLumo
  • 26,204
  • 2
  • 57
  • 87