0

How do I catch error of that command into a var or following if-statement (nb $? always gets set 0):

mysqldump $db | gzip -9 > /opt/backup/dbdumps/$db-$stamp.sql.gz

Default redirect 2> $foo fails with ambiguous redirect error. I guess because bash does not know which command's stderr to redirect? But where to put some brackets or that stuff?

toshniba
  • 383
  • 5
  • 18

0 Answers0