I have output from a shell script like below
output1 ..... 1
output2 ..... 2
output3 ............3
I tried to format it with equal spacing inside script but output still not have uniform spacing.
I want to print the output like below.
output1 ..... 1
output2 ..... 2
output3 ......3
Are there any commnads available to get this done. I use bash.
here is the code.
lnode=abc
printf "server name ......... "$lnode""
printf "\nserver uptime and load details : ......... `uptime`"
printf "\n"
lcpu=`cat /proc/cpuinfo | grep -i process |wc -l`
printf "Total number of CPUs on this server : ......... $lcpu\n"
-Thanks.
printfcommand does what you need, doesn't it?printfformat specifiers allow you to specify the width of the field. Why would you need to pass any options?