printf: edit page (#12449)

* printf: edit page

* Update pages/common/printf.md

Co-authored-by: Muhammad Falak R Wani <falakreyaz@gmail.com>

* printf: update example

---------

Co-authored-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
This commit is contained in:
Fazle Arefin
2024-03-04 00:47:08 +11:00
committed by GitHub
parent f114d5cd2e
commit a2ea10ad8b

View File

@@ -22,3 +22,7 @@
- Store a formatted message in a variable (does not work on zsh): - Store a formatted message in a variable (does not work on zsh):
`printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}` `printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}`
- Print a hexadecimal, octal and scientific number:
`printf "{{hex=%x octal=%o scientific=%e}}" 0x{{FF}} 0{{377}} {{100000}}`