Please help me. I have been doing this for several hours.
Here is the code
if [\("$var1"=="xxx"\) -o \("$var2"=="0"\)] then
echo a b c d >> file.txt
echo 1111 >> file.txt
fi
The reason I want the two echo is because I want these statements printed on multiple lines. I keep getting error .
First it tells me fi is not expected, I take that out . then it teslls me if is not matched what do I do?
Thanks.
Scott
2
Hi.
You need a semi-colon ; between ] and then...
if [\("$var1"=="xxx"\) -o \("$var2"=="0"\)]; then
(or put then on the next line)
Also, you need spaces before and after [ and ] and either side of ==, even though these are wrong. single = are correct.
And I don't know what all the slashes \ and brackets ( and ) are for.
if [ "$var1" = xxx -o "$var2" = 0 ]; then
Thanks for your help. I appreciate it.
it worked!!!!!!!!