How to write a condition in Bourne shell
keramida at ceid.upatras.gr
Mon Nov 5 04:03:06 PST 2007
On 2007-11-05 14:03, Olivier Nicole <on at cs.ait.ac.th> wrote:
> I am a lame Bourne sheel programmer, how to write:
> while [ ( $? -ne 0 ) -a ( $retry -gt 0 ) ] ; do
> that should execute as long as $? is not null and $retry is greater
> than 0?
Try something like...
while [ $done -eq 0 ] && [ $retry -lt 10 ]; do
if [ $? -eq 0 ]; then
if [ $done -eq 0 ]; then
echo "Failed after $retry attempts."
More information about the freebsd-questions