#422 Issue closed: unary operator expected with BACKUP_TYPE

Labels: bug

gdha opened issue at 2014-06-06 13:26:

a minor fix for
usr/share/rear/verify/NETFS/default/07_set_backup_archive.sh
usr/share/rear/verify/NETFS/default/55_check_backup_archive.sh
usr/share/rear/restore/NETFS/default/40_restore_backup.sh

Therein

  if [ $BACKUP_TYPE == "incremental" ]; then
should be changed to
  if [ "$BACKUP_TYPE" == "incremental" ]; then

This avoids error messages like "[: ==: unary operator expected"
when $BACKUP_TYPE is unset or the empty string - e.g.:

$ if [ $BACKUP_TYPE == "incremental" ]; then echo foo ; fi
bash: [: ==: unary operator expected

$ if [ "$BACKUP_TYPE" == "incremental" ]; then echo foo ; fi
$

Kind Regards
Johannes Meixner


[Export of Github issue for rear/rear.]