Afficher un message
Vieux 15/08/2007, 16h40   #8
Sven Joachim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: view the exit status from command line

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
  Réponse avec citation
 
Page generated in 0,04932 seconds with 9 queries