|
|
|
|
Essaye cette construction sous bash:
johan@johan:~$ myvar=abc_def_ghi
johan@johan:~$ echo ${myvar%%_*}
abc
johan@johan:~$ thefile=DSC0123-987.jpg
johan@johan:~$ echo ${thefile%%-*}
DSC0123
Partie finissante extension
johan@johan:~$ echo ${thefile##*.}
jpg
man bash Remplacement des paramètres Gates gave you the windows. GNU gave us the whole house.(Alexandrin) |