Quote:
Originally Posted by
vee_789
Hi
You mean i will change the code in the if loop to the one which you have provided. What difference would it make by putting the -a option. Could you please explain me.
I think there's some problem with the way your shell interprets if condition mentioned in your script (by the way, if-else -> conditional statements, not a loop). I'm not getting an error when I say this to my shell: if [ condition1 ] && [ condition2 ]. (I'm using GNU Bash, version 3.1.17)
May be you're using an older version of bash. Try one of the following options:
1. if [ condition1 -a condition2 ]
2. if [[ condition1 && condition2 ]]