Current Size:
Chakra BreakPoints
base0px
sm480px
md768px
lg992px
xl1280px
2xl1536px
Current Height:Width
widthpx
heightpx

Subjects

More Advanced Formatting Pattern Bash

Date Created: 2022/09/23

Last Update: 2023/06/16

#bash #process #workflows #reference

Using printf

printf "%s\n" "hello world from printf"
hello world from printf
$ printf "%s\n" "hello printf" "in" "bash script"
hello printf
in
bash script

Advanced Formatting

Table

sdsd

#/bin/bash
divider="=============================="
divider=$divider$divider
header="\n %-10s %8s %10s %11s\n"
format=" %-10s %08d %10s %11.2f\n"
width=43
printf "$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

More Notes

All Notes
HomeProjects

Links

Home Articles Notes Projects About Style Guide Site Credits

Contact

 [email protected]

Location

🌎 Earth