Plasma
Plasma

Reputation: 105

Tab a scripts output

I want command output to turn from:

really
long
line

to output like this:

    really
    long
    line

Upvotes: 0

Views: 244

Answers (1)

ichramm
ichramm

Reputation: 6642

The tab width can be changed using the tabs command:

For exaple:

root@d6cf49e7d107:/# tabs -4 && echo -e "hello\tworld"
hello   world                                                                                                                                                                                                                         
root@d6cf49e7d107:/# tabs -2 && echo -e "hello\tworld"
hello world                                                                                                                                                                                                                           
root@d6cf49e7d107:/# tabs +8 && echo -e "hello\tworld"
hello   world                                                                                                                                                                                                                         
root@d6cf49e7d107:/# tabs +20 && echo -e "hello\tworld"
hello               world 

Update: The setting is not persistent. i.e.: It will be valid until the session is closed, this means it is safe to use it inside a script.

Upvotes: 1

Related Questions