•
•
•
•
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 422,386 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 4,664 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
Views: 490 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Posts: 40
Reputation:
Rep Power: 1
Solved Threads: 0
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?
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
Perhaps
if [ "$1" == "" ]; If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the Shell Scripting Forum
- Previous Thread: Calling GDB commands from Shell
- Next Thread: Trying to rewrite srm (safely remove): problem with spaces in filenames



Linear Mode