Comparing strings

ELCV <[email protected]>
Newsgroups alt.comp.lang.shell.unix.bourne-bash
Message-ID <[email protected]>
Hello

I can't get this right. What I have is a script to backup VM guests. The command is called with an argument, for example:

/usr/local/bin/vm-backup.sh FOO

Some of the VMs have two disks and I want to back them both up. Two of the VMs have vert large data partitions that are backed up separately and I want to exclude them. 

If I do this: 

if [ "$1" != "FOO" ];
 then
       echo "I can backup the 2nd volume";
else
        exit;
fi

It works. But if I add an "or" condition as follows:

if [ "$1" != "FOO" ]   ||  [ "$1" != "BAR" ] ;
 then
       echo "I can backup the 2nd volume";
else
        exit;
fi

It fails. I have tried this a number of different ways and I can't get it. Any guidance is appreciated. Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.