3

I want to paste <TAB> into command line, in order to execute cut command with <TAB> as the delimiter. Everytime I try to do it, it simulates clicking the tab key and completes the command with some file(-s) from the current directory.

Is there any solution (I've tried copying straight from text editor)?

Mac OS X 10.7.5, running bash.

4

You can insert a literal tab by pressing Ctrl-v (quoted-insert) and tab.

You can insert tabs in strings with $'\t':

cut -f2 <<< $'aa\tbb'

Or use pbpaste:

pbpaste | cut -f2

This makes tab just insert a tab:

bind '"\t": self-insert'

If you use option as meta, adding this to ~/.inputrc would make ⌥⇥ insert a tab:

"\e\t": "\C-v\t"
  • Is C-v, Command-v or Control-v? – Ɱark Ƭ Feb 28 '13 at 14:12
  • C-v is Control-v – nohillside Feb 28 '13 at 18:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .