![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| using awk != parameter | karthikn7974 | Shell Programming and Scripting | 4 | 04-28-2008 07:59 AM |
| checking parameter values passed to script | ammu | UNIX for Dummies Questions & Answers | 2 | 10-05-2007 01:35 PM |
| how do I make dynamic parameter names? Or get the value of a parameter evaluated twi | Awanka | Shell Programming and Scripting | 2 | 04-19-2007 10:37 PM |
| parameter | u263066 | Shell Programming and Scripting | 5 | 10-12-2006 04:46 AM |
| $- parameter ... | moxxx68 | UNIX for Dummies Questions & Answers | 2 | 02-10-2005 07:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Parameter Checking
Hi all,
My script has 2 mandatory and 1 optional paramter. If the third parameter(optional) one is null the it should take a default value say 3. Can any one please write a simple code. sh test.sh 1 2 3 var1=$1 var2=$2 if [ -z $3 ] then var3=3 fi echo " the third variable $var3" But this is erroring out saying " test.sh: test: argument expected" Thanks in advance Ammu |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|