Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

name required

Status
Not open for further replies.

darfader

Programmer
Aug 6, 2003
38
GB
Hi,

there are items in shell scripting like $# and $?

what are these items called please ?


tia,
 
The bash manual page lists them as
Code:
   Special Parameters
       The  shell  treats  several parameters specially.  These parameters may
       only be referenced; assignment to them is not allowed.
...
       #      Expands to the number of positional parameters in decimal.
       ?      Expands  to  the status of the most recently executed foreground
              pipeline.
 
ty Salem


so I can trap a value from a command, say sqlload... and test it

RESULT=$?

if [ $RESULT != 0 ]
then
echo "customer_details sqlload fails with $RESULT"
exit 1
fi

 
Yes, that's the way to do it.

I would imagine that fairly complex commands like 'sqlload' would have a number of exit status codes to describe reasons for failure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top