On Fri, 2003-10-31 at 14:16, Arindam Dey wrote: > On Fri, 2003-10-31 at 12:00, Iain Buchanan wrote: > > I have a litte problem for which I'm looking for ideas. I want to run a > > program in while loop like this: > > > > while :; do rdesktop host; sleep 1; done > > > > However, if I put this into a launcher on my menu: > > > > bash -c "while :; do rdesktop host; sleep 1; done" > > > > then when I disconnect, it reconnects again! [snip] > > Using the above "echo $?" you can take the exit condition and put in a > conditional while loop instead of infinite while. Thanks, that gave me an idea! (even though I didn't explicitely use $?): bash -c "while :; do rdesktop host && break; sleep 1; done This way, if rdesktop returns 0, break isn't executed, but if rdesktop returns 1, break is executed and the while loop stops. Now bash nicely sits in the background until the server is ready, and rdesktop then appears. Thanks, -- Iain Buchanan <iain@xxxxxxxxxxxxxxxxxxx> Yesterday I was a dog. Today I'm a dog. Tomorrow I'll probably still be a dog. Sigh! There's so little hope for advancement. -- Snoopy -- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list