Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to check in a shell script whether subversion is installed. For that I chose to check the exit code after the program has been executed. I tried using command svn, but that prints out the output of the command (Type 'svn help' for usage.). If I suppress it with 2>/dev/null the result is an empty string.

How could I make it work?

share|improve this question
    
you should work a bit on your 'accept-answers' rate ... –  akira Feb 12 '11 at 19:26
    
@akira - should I care? If I don't get a satisfying answer, I don't approve any. If that's what that is about... –  jurchiks Feb 12 '11 at 19:33

1 Answer 1

up vote 1 down vote accepted

The exit code of the last executed program is stored in $?.

share|improve this answer
    
... "so do a echo $? and have a look". –  akira Feb 12 '11 at 19:25
    
@shellholic - thx, helped. @akira - stop post-hunting... –  jurchiks Feb 12 '11 at 19:34
    
@jurchiks: stopping what? –  akira Feb 12 '11 at 20:12
    
@shellholic - do you, by any chance, know, how to do the same in Windows? I'm writing the same script for both Windows and Linux. –  jurchiks Feb 12 '11 at 21:05
    
@jurchiks answered here: stackoverflow.com/questions/334879/… –  shellholic Feb 12 '11 at 21:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.