OVH Community, votre nouvel espace communautaire.

script bash -affectation d'une variable


mikro
05/01/2007, 16h34
Oups !

Merci beaucoup !

Bon week end

Homer Jay
05/01/2007, 15h32
Citation Envoyé par mikro
REPERTOIRE = `pwd`

./rep.sh: line 3: REPERTOIRE: command not found
Il ne faut pas d'espaces autour du «=» en bash.

mikro
05/01/2007, 08h37
Bonjour

Je souhaite récupérer la valeur retournée par une commande shell dans une variable

j'utilise pour cela les simples cotes inversées, mais cela semble ne pas fonctionner ????

Y a t-il une alternative ?

*****************
#!/bin/sh

REPERTOIRE = `pwd`
echo $REPERTOIRE
**************************


login@ssh1:~/cron.daily$ ./rep.sh
./rep.sh: line 3: REPERTOIRE: command not found