Welcoming HLFS back into the fold
dbn.lists at gmail.com
Wed Mar 28 12:25:24 PDT 2007
On 3/28/07, M.Canales.es <macana at macana-es.com> wrote:
> El Miércoles, 28 de Marzo de 2007 20:58, Dan Nicholson escribió:
> > Ideally, this would go back to Robert and into HLFS, or something else
> > that makes the commands be successful. IMO, it's bad form to have
> > commands that are known to fail. Even if you're not scripting, a wise
> > person will ensure that commands are returning successfully.
> The book explanations says that it must fail and show the output errors
> Thats wy the book add "echo $?" after the command run, to be sure that the
> return status is not "0".
In that case, if the rest is really to see that the return code is
some non-0 value, then that's what it should test.
$ ./ssp_test || echo $? | grep 134
That command will return successfully if it fails the way Robert has
explained it. It will still show the "smashing" output, too, since it
goes to stderr. Here's an example:
$ barf || echo $? | grep 127
-bash: barf: command not found
$ echo $?
More information about the alfs-discuss