I have a file of name output.txt, If the file output.txt is not empty then I need to exit the script with exit code 1.
I tried the below code but not getting the desired output:
#!/bin/bash
OUT=`cat output.txt`
if [ "$OUT" -eq 0 ]
then
  echo "The script ran ok"
  exit 0
else
  echo "The script failed"
  exit 1
fi
 
    