
March 7th, 2011, 05:28 AM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 22
Time spent in forums: 4 h 5 m 10 sec
Reputation Power: 0
|
|
|
Syntax error in If loop
I have a requirement to check the following conditions..
If my folders are not A and B then list files in the directory else no listing the files
so my if loop is some thing like this.
Code:
if [ $dirName = "C" && $dirName \!= "A" && \!= "B" ] then
ls -la
else
echo "Inside else loop"
fi
But upon executing I am getting the below error..
Code:
./application/root/shellscript/Test.sh: line 5: [: missing `]'
Please help me..if there is any thing wrong in the syntax
|