Matt Price <[EMAIL PROTECTED]> writes: > David Z Maze wrote: > > > See earlier commentary about XEmacs; gnuclient(1) is the XEmacs > > equivalent to emacsclient, and it does claim to support a -nw > > option. I could see things being unhappy if you set $EDITOR to > > that, but it's easy enough to write a shell script: > > > > #!/bin/sh > > # moremacs: open a file under gnuclient > > exec gnuclient -nw "$@" > > gnuclient -nw does indeed work! thanks. > > Now a question: the problem with setting my editor to gnuclient -nw > is that I may at times not have xemacs running on the computer. > Then gnclient exits with an error message, and I can't write mail > (not fatal) -- in mutt I can get a shell and start xemacs -unmapped; > but still...) So I'd like to wrote a script that does something > like this: > > -try to run gnuclient; if it works, exit > else > -run xemacs -nomapped > -run gnuclient > > is it possible in bash to test whether a comand has actually worked?
The '||' operator does this, like: #!/bin/sh gnuclient "$@" || xemacs -nomapped "$@" || vi "$@" or something. Lucas -- Tired of getting duplicate copies of mailing list messages? I respect the 'mail-followup-to' header field: http://cr.yp.to/proto/replyto.html -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]