If I have zero byte file and it is executable, it will just do nothing. Can I fail on such files, i.e. return some error message and/or return non-zero exit code?
1 Answer
So, I think the only answer answer is
if [ -s mybinary ]
then
   mybinary
else
   exit 1
fi
right?
- 
        2what difference does it make if the file is empty or contains just a newline, a zero byte, a comment line or multiple newlines, etc?user313992– user3139922020-02-13 12:53:17 +00:00Commented Feb 13, 2020 at 12:53
- 
        you are right, hence the answer is incorrectDims– Dims2020-10-10 21:01:03 +00:00Commented Oct 10, 2020 at 21:01
truecommand. Do you wantsh -c ''to return an error message or a non-zero exit code as well?