The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-24-2008
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
You code works for me, and IS case sensitive:
Code:

# cat check
if [ -d $1 ]; then
echo '- OUT_DIR exists'
else
echo; echo; echo 'ERROR: OUT_DIR does not exist'
exit 1
fi

# ll
total 8
-rw-r--r-- 1 root root 107 Nov 24 12:56 check

# sh check Test


ERROR: OUT_DIR does not exist

# mkdir Test

# ll
total 16
-rw-r--r-- 1 root root  107 Nov 24 12:56 check
drwxr-xr-x 2 root root 4096 Nov 24 12:57 Test

# sh check Test

- OUT_DIR exists
# sh check test


ERROR: OUT_DIR does not exist
 #