Hi! Trying to kill the keyboard, satan3@home.com produced:
How can I execute a program and leave X cleanly in a shell script? What would I follow the program execution with to exit X?:
#!/bin/sh exec program exec xtexit
but it would just exec the first program and stop. Appreciate a nudge in the right direction.
Well, it's described in the manual (man bash --> "exec "), so its a feature. Try #! /bin/sh /path/program /path/xtexit which will block the shell, as long as program is running. If program detaches or ends (it looks the same for the shell, the process dies --- detaching means a forked child lives on), xtexit will be run. Note that you do not want /path/program & for obvious reasons, and giving the path almost never hurts. -Wolfgang PS: The 'logout'-Button-method uses exec: Login starts a (non-interaktive) shell, which starts all the nice programs and is thus (grand)*father to everything you run: WM, xclock, xterms etc. Then it execs xlogout, which gets the (grand)*father position --- it dies after a mouse click. Thus, everything you own (except nohup etc.) is closed: #! /bin/sh Proggie_1 & Proggie_2 & Proggie_3 & exec xlogout -- PGP 2 welcome: Mail me, subject "send PGP-key". If you've nothing at all to hide, you must be boring. Unsolicited Bulk E-Mails: *You* pay for ads you never wanted. Is our economy _so_ weak we have to tolerate SPAMMERS? I guess not. - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e