On 3/28/07, M.Canales.es <[EMAIL PROTECTED]> 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
> generated.
>
> 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
127
$ echo $?
0

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to