Using printf
printf "%s\n" "hello world from printf"hello world from printf
$ printf "%s\n" "hello printf" "in" "bash script"hello printfinbash script
Advanced Formatting
Table
sdsd
#/bin/bashdivider="=============================="divider=$divider$dividerheader="\n %-10s %8s %10s %11s\n"format=" %-10s %08d %10s %11.2f\n"width=43printf "$header" "ITEM NAME" "ITEM ID" "COLOR" "PRICE"printf "%$width.${width}s\n" "$divider"printf "$format" \Triangle 13 red 20 \Oval 204449 "dark blue" 65.656 \Square 3145 orange .7