Re: cowsay et xcowsay
Le Sat, 23 Mar 2013 19:56:32 +0100,
Christophe <tech@stuxnet.org> a écrit :
> Bernard Schoenacker a écrit :
>
> > Bonjour,
> >
> >
> > Si j'ai bien compris c'est du genre :
> >
> > if[ -n $DISPLAY ] ;then fortune -s|xcowsay ;else fortune
> > -s|cowsay -f tux fi zsh: parse error near `then'
> > Merci de bien vouloir corriger
> >
> > slt
> > bernard
> >
>
> Essaye voir ca :
>
> if [ -n $DISPLAY ]; then fortune -s|xcowsay ;else fortune -s|cowsay
> -f tux ;fi
>
>
Bonjour,
concernant le script, il fonctionne très bien avec un /dev/pts/n mais
pas en tty, par conséquent, il faut revoir le script contenant des
variables a=b (?) ...
source de l'exemple :
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-6.html
T1="foo"
T2="bar"
if [ "$T1" = "$T2" ]; then
echo expression evaluated as true
else
echo expression evaluated as false
fi
application :
T1=[ -n $DISPLAY ]
T2= tty
if [ "$T1" = "$T2" ]; then
fortune -s|xcowsay
else
fortune -s|cowsay -f tux
fi
résultat, je suis également arrivé au stade précédent ....
slt
bernard
Reply to: