sh unexpected operator

Zdeněk Kolařík zkolarik at cmengineering.cz
Mon May 27 11:40:48 CEST 2013


Dne 27.5.2013 11:10, Radek Krejča napsal(a):
> #!/bin/sh
>
> while :
> do
> souburek=`ps -axw | grep souburek | grep -v grep | awk '{ print $9 }'`
> if [ -z $souburek ]; then
> echo "Nejde"
> /bin/sleep 10
> fi
> done
>

Jestli to dobre chapu, usnuti na 10 s by melo probehnout vzdycky
a nezavisle na podmince. Zkusil bych to drobne pozmenit:

#!/bin/sh

while :
do
{ 
  souburek=`ps -axw | grep souburek | grep -v grep | awk '{ print $9 }'`
  if [ -z $souburek ]; then
    echo "Nejde"
  fi
  /bin/sleep 10
}
done




More information about the Users-l mailing list