How to set 4 space tab in bash

前端 未结 5 856
囚心锁ツ
囚心锁ツ 2021-02-01 16:11

It look like set tabstop=4 in VIM, but I don\'t know how to set it in bash

for example:

echo -e \"1234567890\\t321\\n1\\t2\         


        
5条回答
  •  鱼传尺愫
    2021-02-01 16:21

    That's not a property of your shell (or php or cat). It's your terminal that manages the output.

    Use the tabs command to change the behavior:

    $ tabs 4
    
    $ echo -e "a\tb"      
    a   b
    $ tabs 12
    
    $ echo -e "a\tb" 
    a           b
    

    (tabs is specified in POSIX, and output above is "faked": it's still a tab character between the two letters.)

提交回复
热议问题