I'm trying to write a simple bash script that checks the string if value is not "rpm" or "jar". But it seems to always be evaluating to true. I'm not sure what I'm missing.
#!/bin/bash
FILE_EXTENSION="rpm"
if [ "$FILE_EXTENSION" != "jar" ] || [ "$FILE_EXTENSION" != "rpm" ];
then
echo "File type is NOT rpm or jar";
else
echo "File type is rpm or jar";
fi
echo "Debug: FILE_EXTENSION value is $FILE_EXTENSION"
Running it on my local gets below output. It evaluates to true even though FILE_EXTENSION variable is set as "rpm"
$ ./check3.sh
File type is NOT rpm or jar
Debug: FILE_EXTENSION value is rpm
$