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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-23-2007
aigles's Avatar
aigles aigles is offline
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,212
Code:
var1=$1
var2=$2

if [ -z "$3" ]
then
var3=3
fi

echo " the third variable $var3"
or
Code:
var1=$1
var2=$2
var3=${var3:-3}
echo " the third variable $var3"
Jean-Pierre.
Reply With Quote