Printf formatting

From thelinuxwiki
Revision as of 20:14, 31 October 2013 by Nighthawk (Talk | contribs)

Jump to: navigation, search

just go here...

http://wiki.bash-hackers.org/commands/builtin/printf

$ printf "%10s%10s\n" "foo" "bar"                                                                                                            
      foo       bar
$ printf "%-10s%10s\n" "foo" "bar"                                                                                                           
foo              bar
$ printf "%10s%-10s\n" "foo" "bar"                                                                                                           
      foobar       
$ printf "%-10s%-10s\n" "foo" "bar"                                                                                                          
foo       bar