Bash script allign the output

How to use bash script allign the output. To use printf command the format of strings. Many method to allign the ouput use bash script. The script my below simple.

Bash script align the output
#!/bin/bash
for b in "H HU HUU PHAN PHANVAN"
do
        echo "$b"
        for c in $b
        do
                printf "%-50sOK\n" "$c"
        done
done

Running bash script
[huupv@huupv Downloads]$ ./studyscript.sh 
The display as below

Bash script allign the output

Comments

Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server

How to install php7 on centos 6