I'm trying to run a script that will do one of two things, depending on whether or not a directory is empty. The script so far is as follows:
The problem is that $num_sii is a string with leading spaces, and I need to convert that to an integer. This is probably very simple, but I don't know how to do it. Any help would be appreciated!
-Joe
Code:
#!/bin/bash
num_sii=`ls /home/sii/incoming/ | wc -l`;
if [$num_sii -eq 0]
then
echo "There aren't any new files.\n"
else
echo "There are $num_sii new responses."
...
fi
-Joe