Brazen
December 6th, 2006, 06:57 PM
Ok, I have three conditions that I need to test for. Here is a snippet of what I have:
while [ -n $FILE_1 -o -n $FILE_2 -o -n $FILE_3 ]; do
echo "do some stuff here..."
...
done
But this is giving me a "too many arguments error." If you can't tell, I'm using '-n' to test if a file has a non-zero length and using '-o' to test the three files. This isn't working for me and I'm wondering how I can test these three conditions in a while loop.
while [ -n $FILE_1 -o -n $FILE_2 -o -n $FILE_3 ]; do
echo "do some stuff here..."
...
done
But this is giving me a "too many arguments error." If you can't tell, I'm using '-n' to test if a file has a non-zero length and using '-o' to test the three files. This isn't working for me and I'm wondering how I can test these three conditions in a while loop.