The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 10-13-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by reksab_16 View Post
Hi Gurus,

New to Unix... What does the following if commands do?

if [ ! "$ORACLE_HOME" ]
then
. ${HOME}/.profile
fi

if [ ! "$COMMON_SOURCED" ]
then
. ./.common
fi

If the variable is empty or unset, then execute the code.

The more usual way to do it is:

Code:
if [ -z "$ORACLE_HOME" ]
then
. ${HOME}/.profile
fi
Quote:

Also please give me some tutorials for Unix which I can start with. Also please gimmme examples for shell scripting.

Here are some links to shell resources.