Re: scripting gnuclient and emacs for mutt [ was: emacsclient -nw]
On Thu, Nov 20, 2003 at 04:29:39PM +0000, Colin Watson wrote:
> On Thu, Nov 20, 2003 at 10:49:45AM -0500, Matt Price wrote:
> > is it possible in bash to test whether a comand has actually worked?
> > I feel like I've seen such tests, but I tried one and can't make it
> > work for me:
> >
> > #! /bin/bash
> > if [ 'gnuclient -q $*' ]; then
>
> That's definitely wrong: 'gnuclient -q $*' is just a string, not "call
> this program". Also, there's no need to use [ ] (a.k.a. /usr/bin/test)
> for this purpose. Just check the program's exit status directly:
>
> if gnuclient -q $*; then
> # success
> else
> # failure
> fi
>
thanks colin, that's solved it. Now I have the problem that xemacs
takes so long to load that gnuclient can't find it before exiting, but
I should be able to solve that...
thx,
matt
Reply to: