Hi Stephen,

It depends on what shell you are using.  For csh or tcsh, you can use
$status or $?.  For sh, ash, bash, bash2, ash, use $?.

So,

$ ls
...
$ echo $?
0
$ ls | grep bleah
1
$

The first echoes 0 because the 'ls' command is successful.  The second
echoes 1 because there's not 'bleah' file.

Etienne


Stephen King wrote:

> What is the echo command that returns a 0 if the previous command ran
> correctly?



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to