Re: view the exit status from command line

2007-08-16 Thread Jude DaShiell
It only takes one line appended to a shell script: echo $_ status.log -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]

Re: view the exit status from command line

2007-08-15 Thread Glennie Vignarajah
Le Wednesday 15 August 2007, Kamaraju Kusumanchi(Kamaraju Kusumanchi [EMAIL PROTECTED]) a écrit: Hi, Let's say I run a command in bash which is run via konsole. How can I view its exit status. For example, if I do $test -x debian/rules try: test -x debian/rules ; echo $? HTH, --

Re: view the exit status from command line

2007-08-15 Thread Joachim Fahnenmüller
Hi Kamaraju On Wed, Aug 15, 2007 at 12:51:06AM -0700, Kamaraju Kusumanchi wrote: Let's say I run a command in bash which is run via konsole. How can I view its exit status. For example, if I do $test -x debian/rules I want to know if the command exited with status zero or non-zero.

Re: view the exit status from command line

2007-08-15 Thread Kamaraju S Kusumanchi
Joachim Fahnenmüller wrote: For example, if I do $test -x debian/rules I want to know if the command exited with status zero or non-zero. Can this be done in a simple way? $test -x debian/rules; echo $? Thanks. Exactly what I am after! raju -- Kamaraju S Kusumanchi

Re: view the exit status from command line

2007-08-15 Thread Sven Joachim
Kamaraju S Kusumanchi [EMAIL PROTECTED] writes: I want to know if the command exited with status zero or non-zero. Can this be done in a simple way? $test -x debian/rules; echo $? Thanks. Exactly what I am after! Here's a $0.02 recipe from my ~/.bashrc: if [ $PS1 ]; then

Re: view the exit status from command line

2007-08-15 Thread Ken Irving
On Wed, Aug 15, 2007 at 04:21:17PM +0200, Sven Joachim wrote: Kamaraju S Kusumanchi [EMAIL PROTECTED] writes: I want to know if the command exited with status zero or non-zero. Can this be done in a simple way? $test -x debian/rules; echo $? Thanks. Exactly what I am after!

Re: view the exit status from command line

2007-08-15 Thread Håkon Alstadheim
Ken Irving wrote: On Wed, Aug 15, 2007 at 04:21:17PM +0200, Sven Joachim wrote: Kamaraju S Kusumanchi [EMAIL PROTECTED] writes: I want to know if the command exited with status zero or non-zero. Can this be done in a simple way? $test -x debian/rules; echo $?

Re: view the exit status from command line

2007-08-15 Thread Ken Irving
On Wed, Aug 15, 2007 at 09:42:16PM +0200, Håkon Alstadheim wrote: Ken Irving wrote: On Wed, Aug 15, 2007 at 04:21:17PM +0200, Sven Joachim wrote: Kamaraju S Kusumanchi [EMAIL PROTECTED] writes: I want to know if the command exited with status zero or non-zero. Can this be done in a

Re: view the exit status from command line

2007-08-15 Thread Sven Joachim
Håkon Alstadheim [EMAIL PROTECTED] writes: You don't need a command (at least with the versions of bash I've used the last 10 years), just make sure the variable does not get expanded before it is assigned to PS1. Like so: PS1='$?\$ '. now try executing /bin/true and /bin/false. Indeed,