LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-14-2005, 06:54 AM   #1
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
Bash - what does if [ ${?} -ne 0 ] mean?


More specifically, what does the ${?} bit mean...?

Dave
 
Old 09-14-2005, 07:13 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
Here, ${?} is strictly equivalent to $?, which means the return value of the last executed command.

See "man bash".

Yves.
 
Old 09-14-2005, 07:58 AM   #3
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
@Yeti: it is nearly impossible to search for that in the bash man page, please forgive that user for being unable to do the impossible :P

@davee: as yeti mentioned, it's the return value of the last process executed. Usually a process returns 0 on success and a non-zero value on error so this code snippet is for checking if the last executed process was being run successfully.
 
Old 09-14-2005, 07:58 AM   #4
davee
Member
 
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Original Poster
Rep: Reputation: 30
Cheers...! It's not the easiest thig to search for in google.

Dave
 
Old 09-14-2005, 08:57 AM   #5
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
Quote:
Originally posted by davee
Cheers...! It's not the easiest thig to search for in google.

Dave
huh, why use google when LQ has a "man page" page............

http://man.linuxquestions.org/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
$LINENO can't be modified in bash 3.0, while it can be in bash 2.05b Darwish Linux - Software 1 11-07-2005 03:57 PM
Bash Echo Kilo Linux - General 3 11-03-2005 12:11 AM
bash help brianbek Linux - General 2 04-03-2005 07:03 PM
bash + html + javascript or just bash ? rblampain Programming 4 12-01-2004 08:53 AM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration