3 ms·
Exit traps for cleanup are a good idea in any case. Scripts can be killed by signals and whatnot as well. I'm not sure what scenario you're imagining with your
by matt_kantor 11y ago
Exit traps for cleanup are a good idea in any case. Scripts can be killed by signals and whatnot as well.
I'm not sure what scenario you're imagining with your other concern. This does what you would expect:
set -o errexit
if [ -f somefile ]
then
echo "File exists."
else
echo "File does not exist."
fi