User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 455,866 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,662 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums

checking argument wheather is empty

Join Date: Nov 2007
Posts: 40
Reputation: picass0 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
picass0 picass0 is offline Offline
Light Poster

checking argument wheather is empty

  #1  
Jul 19th, 2008
i wanted to check my args wheather is a empty string or -P when i run my code but it prompt an error msg. The error msg say i have an unary operation expected at line 3 and 7.
m i doing a wrong way to check for empty argument? if i wanted to check for empty argument how m i going to do it?
if test $1 == "-P" then
read -p "Enter username: " username
elif test $1 == " " then
echo "Args Requires"
fi
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 6:18 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC