Error with shell scripting -
!#/bin/bash svnadmin dump /path/to/repo | gzip -9 > /path/to/backup.bak-$(date +"%d\%m\%y--%t").dump.gz if ( `echo $?` -eq 0) echo "hello world" | mail -s "a subject" someone@wherever.com else echo "sorry, no way out" | mail -s "a subject" someone@wherever.com exit 1 fi
there edit question
any appreciated. output else part " sorry no way out! expect hello world dump command works
your if
clause should be: if [ $? -eq 0 ]
. notice square brackets , whitespaces around them.
Comments
Post a Comment