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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -