Re: Shell scripting in Bash
Hi Dale!
}if [ a != b ]
}
}works fine
}
}if [ a != b || c != d ]
}fails with several errors ( ']' not found, and != command not found )
}
}I have tried to enclose the expressions in {} with the same results.
}
}What is the correct syntax for this kind of statement?
if [ a != b -o c != d ]
{ test a != b && echo "jo" } || { test c != c && echo "jojo" }
Is one of the above what you expected?
Regards,
Joey
--
/ Martin Schulze * joey@infodrom.north.de * 26129 Oldenburg /
/ http://home.pages.de/~joey/
/ Install joe (Joey's Own Editor) correct: Joe's Own Editor /
Reply to: