Hello,
je viens de faire une fonction simple en shell,
mais j'ai un espace de trop a la fin de ma ligne, savez-vous comment je
peux faire pour couper le dernier caractere d'une ligne ?
1 # Implements LISP "cdr" on list given
2 # BUG: this function appends a \s at the end of the result
3 #
4
5 function cdr {
6 echo $@ | awk '{for (I=2; I<=NF; I++) {print $I}}' | tr '\n' ' '
7 }
-bash-2.05b$ source .bash_functions
-bash-2.05b$ echo "_$(cdr Hello World)_"
_World _
Olivier
Linux-Azur : http://www.linux-azur.org
Désinscriptions: http://www.linux-azur.org/liste.php3
**** Pas de message au format HTML, SVP ****