[Gllug] show non-zero exit code in bash

Greater London Linux User Group gllug at gllug.org.uk
Wed Dec 28 00:30:00 UTC 2005


salsaman <salsaman at xs4all.nl> writes:

> I was playing around with this idea over Christmas, here is what I
> came up with:
>
> _() { $@; echo $?; }
>
>
> then after that, you can run any command with _<space> before it, e.g.:
>
> _ false
> _ true

I tried (not very hard, I admit) to find a way to do this without the
massive overhead of having to type '_ '. Couldn't.

Mind you, thinking about it a bit there seems to be something
fundamentally wrong with the idea that the shell could mess with the
stdout/err of a command.

Matthew

-- 
I must take issue with the term "a mere child," for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20051228/3515bfc9/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list