I need to send an email only if a condition is reached, but I'm having error running this script:
file='/somewhere/here/file.txt'
value=$(cat "$file")
if [$value < 99]; then
echo "$value" | mailx -s "title" me@here.com
fi
the error I'm getting is this:
[line 4: 99]: No such file or directory
file rights: 0755
file '/somewhere/here/file.txt' is present
<
is for input redirection, not for comparison, so that won't work either. – terdon Sep 13 '19 at 10:49