For example, I wanted to use the sort utility with the -t option to specify tab separators, but
sort -t "\t"
doesn't work.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityFor example, I wanted to use the sort utility with the -t option to specify tab separators, but
sort -t "\t"
doesn't work.
Don't use double quotes.
sort -t $'\t'
Or I think Ctrl V inserts a Tab??
Edit:
http://www.gnu.org/s/bash/manual/html_node/ANSI_002dC-Quoting.html#ANSI_002dC-Quoting
$'...'
trick, though; now I've learned something new. :-)
– L2G
Nov 28 '11 at 17:04
$' '
. It allows you to enter a string, but also have escaped characters. Double quoting literally prints \t
If you leave off the quotes you get a tab character.
– surfasb
Nov 28 '11 at 17:09
Try Control-v, then Tab. If you see the cursor tab over to the right, it worked.
According to the comment by Mark you can also try Control-v and then Control-i.
sort -t " "
(with the literal tab as described above) and it worked for me.
– L2G
Nov 28 '11 at 16:57