On Sun, 17 Oct 2004 01:57:53 +0200 (CEST), Olivier Kaloudoff
<[EMAIL PROTECTED]> wrote:
> 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 }
> 

      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++) {printf("%s ", $I)}} ' 
      7 }



-- 
Jean-Max Reymond
CKR Solutions
http://www.ckr-solutions.com

Linux-Azur :      http://www.linux-azur.org
Désinscriptions: http://www.linux-azur.org/liste.php3
**** Pas de message au format HTML, SVP ****

Répondre à