Re: echo command

2000-09-14 Thread Anthony E . Greene
On 14 Sep 2000 13:55 Stephen King wrote: >What is the echo command that returns a 0 if the previous command ran >correctly? Assuming bash shell: echo $? -- Anthony E. Greene <[EMAIL PROTECTED]> PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C9

Re: echo command

2000-09-14 Thread Etienne Larrivee
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' fi

RE: echo command

2000-09-14 Thread Jamie Smith
echo $? -Original Message- From: Stephen King [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 14, 2000 12:55 PM To: [EMAIL PROTECTED] Subject: echo command What is the echo command that returns a 0 if the previous command ran correctly? _

Re: echo command

2000-09-14 Thread Bret Hughes
Stephen King wrote: > What is the echo command that returns a 0 if the previous command ran > correctly? echo $? will return the return code of the previously run command. 0 if successful. Bret ___ Redhat-list mailing list [EMAIL PROTECTED] https

Re: echo command

2000-09-14 Thread Steve Borho
On Thu, Sep 14, 2000 at 10:55:17AM -0700, Stephen King wrote: > What is the echo command that returns a 0 if the previous command ran > correctly? echo $? But I find it more useful to use other constructs... program_foo && echo "It ran fine" -- Steve Borho Voice: 314-43