Expension
De Linuxmemo.
(Différences entre les versions)
(Une version intermédiaire masquée) | |||
Ligne 1 : | Ligne 1 : | ||
[[Catégorie:Bash]] | [[Catégorie:Bash]] | ||
ref: http://wiki.bash-hackers.org/syntax/pe | ref: http://wiki.bash-hackers.org/syntax/pe | ||
+ | |||
+ | Ne pas confondre avec les expensions de variable: http://linuxmemo.free.fr/index.php?title=Varibles_bash#Expension_de_variable | ||
+ | |||
==Bash expension== | ==Bash expension== | ||
Ligne 20 : | Ligne 23 : | ||
ntp.conf.bak | ntp.conf.bak | ||
- | + | ==Bash brace expension== | |
- | + | http://wiki.bash-hackers.org/syntax/expansion/brace | |
for i in '''{1..12}''';do ping -c 1 192.168.0.{$i} ;done | for i in '''{1..12}''';do ping -c 1 192.168.0.{$i} ;done |
Version actuelle en date du 12 septembre 2019 à 12:30
ref: http://wiki.bash-hackers.org/syntax/pe
Ne pas confondre avec les expensions de variable: http://linuxmemo.free.fr/index.php?title=Varibles_bash#Expension_de_variable
[modifier] Bash expension
mkdir rep{1,2,3} mkdir: création du répertoire «rep1» mkdir: création du répertoire «rep2» mkdir: création du répertoire «rep3»
cp ntp.conf{,.bak} «ntp.conf» -> «ntp.conf.bak» ls ntp* ntp.conf ntp.conf.bak
mv ntp.conf{,.bak} «ntp.conf» -> «ntp.conf.bak» ls ntp* ntp.conf.bak
[modifier] Bash brace expension
http://wiki.bash-hackers.org/syntax/expansion/brace
for i in {1..12};do ping -c 1 192.168.0.{$i} ;done