|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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. Can this be done in a simple way? thank for any suggestions raju ---------------------------------------------------------------------- Finally - A spam blocker that actually works. http://www.bluebottle.com/tag/4 -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Le Wednesday 15 August 2007, Kamaraju Kusumanchi(Kamaraju Kusumanchi
<kamaraju@bluebottle.com>) 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, -- Glennie Vignarajah http://www.glennie.fr An undefined problem has an infinite number of solutions. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Le Wednesday 15 August 2007, Kamaraju Kusumanchi(Kamaraju Kusumanchi
<kamaraju@bluebottle.com>) 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, -- Glennie Vignarajah http://www.glennie.fr An undefined problem has an infinite number of solutions. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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. Can this be done in a simple way? $test -x debian/rules; echo $? man bash: Special Parameters (...) ? Expands to the status of the most recently executed foreground pipeline. > > thank for any suggestions > raju > HTH -- Joachim Fahnenmüller -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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. Can this be done in a simple way? $test -x debian/rules; echo $? man bash: Special Parameters (...) ? Expands to the status of the most recently executed foreground pipeline. > > thank for any suggestions > raju > HTH -- Joachim Fahnenmüller -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 http://www.people.cornell.edu/pages/kk288/ http://malayamaarutham.blogspot.com/ -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
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 http://www.people.cornell.edu/pages/kk288/ http://malayamaarutham.blogspot.com/ -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Kamaraju S Kusumanchi <kamaraju@bluebottle.com> 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 PROMPT_COMMAND='echo -n "$? "' fi This way, an interactive bash will print the exit status of the last command before its prompt, so you can _always_ see it. Very handy, IMO. :-) Cheers, Sven -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
![]() |
| Outils de la discussion | |
|
|