Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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"
share|improve this answer
    
Is C-v, Command-v or Control-v? –  Mark Feb 28 '13 at 14:12
    
C-v is Control-v –  patrix Feb 28 '13 at 18:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.