Re: bash : appel d'un pgm perl

Pàgina inicial

Reply to this message
Autor: jeanluc
Data:  
A: guilde
Assumpte: Re: bash : appel d'un pgm perl
Le Dimanche 18 Juillet 2004 04:33, anne aublanc a écrit :
>
> J'ai trouvé une solution


[...]

> cde_util="perl /usr/sbin/lat-users -a -c"
> arg_util="$a1 | $a2 | $a3 | $a4 | $a5 | $a6 | $a7 | $a8 | $a9 | $a10 |
> $a11"
>
> creer_util="`$cde_util "$arg_util"`"
>

bien vu, felicitation.
effectivement, dans les test 1 et 2, les arguments etaient mal passes
au script perl /usr/sbin/lat-users parce qu'il recevait :

user_creer="perl /usr/sbin/lat-users -a -c 'fax5 | prenom fax5 '"
creer_util="`$user_creer`"
parametres recus par script /usr/sbin/lat-users :
    . arg 1 : -a        ( oui )
    . arg 2 : -c        ( oui )
    . arg 3 : 'fax5     ( ben non )
    . arg 4 : |         ( ben non )
    . arg 5 : prenom    ( ben non )
    . arg 6 : fax5      ( ben non )
    . arg 7 : '         ( ben non )


alors qu'il devait recevoir :
paraPerl="fax5 | prenom fax5 | nom fax5 | toto | | | | | | | "
user_creer="perl /usr/sbin/lat-users -a -c "
$user_creer "$paraPerl"
. arg 1 : -a
. arg 2 : -c
. arg 3 : fax5 |prenom fax5 | | | | | | | | |