informatique:linux:commandes_linux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
informatique:linux:commandes_linux [2021/07/30 13:51] – [type] pteu | informatique:linux:commandes_linux [2021/08/23 08:27] – [printf] pteu | ||
---|---|---|---|
Line 2077: | Line 2077: | ||
</ | </ | ||
+ | =====printf===== | ||
+ | |||
+ | Comme [[informatique: | ||
+ | <code bash> | ||
+ | a=12; b=34; c=' | ||
+ | printf 'a=%i, b=%i, c=%s\n' | ||
+ | a=12, b=34, c=toto | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | Pour formater l' | ||
+ | <code bash> | ||
+ | a=12; b=34; c=' | ||
+ | # on aligne $a et $b à droite sur 5 colonnes, et $c à gauche sur 20 colonnes | ||
+ | printf ' | ||
+ | a= 12, b= 34, c=toto | ||
+ | </ | ||
+ | |||
+ | ====Afficher x fois le même caractère==== | ||
+ | |||
+ | Pour afficher 10 fois le caractère " | ||
+ | <code bash> | ||
+ | printf ' | ||
+ | ========== | ||
+ | </ | ||
=====ps===== | =====ps===== |
informatique/linux/commandes_linux.txt · Last modified: 2024/04/05 06:58 by pteu