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
Running bash script
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.shThe display as below
Comments
Post a Comment