![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jul 2005
Posts: 7
Rep Power: 0
![]() |
capturing and dispatching on command line arguments in bash
I'm having problems with recognizing command line args in my script, whatever "if" I make, they all evaluate to true, what am I doing wrong? here's my test script:
#!/usr/bin/bash
if [ $1=blah ]; then
echo no quotes
fi
if [ $1="blah" ]; then
echo quotes
fi
if [ $1="foo" ]; then
echo foo
fi
echo $1And here's my output: bash-2.05$ ./test.sh blah no quotes quotes foo blah bash-2.05$ Thank you very much in advance |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|