>I don't know why I can't paste tab into bash. > >The following line: > >texts1 # 2 tabs before it > >when pasted into bash, lookes like: > >texts1# 2 tabs before it. > >The 2 (whatever) tabs disapeared.
When you're pasting into a terminal window, the pasted text looks just like ordinary keyboard input. In bash, TAB is the filename completion character by default, not a literal input character. When typing interactively you can enter a literal TAB with C-v TAB, but I don't know offhand of a way to make pasting automatically insert C-v's before each TAB. You'll have to unbind the TAB key first.
sh and csh don't do filename completion (csh has filename completion, but you have to do "set filec" to turn it on), so the TAB is taken as a literal input.
Barry Margolin
> I don't know offhand of a way to make pasting automatically insert C-v's > before each TAB.
oh, I was testing my script interactively in bash, which involes heredoc "expand <<". Knowing above, I changed my method of pasting the whole codes. Instead, I omitted the heredoc part and paste right to the expand.
Thus my tab is not interepreted by bash any more. thanks!