- Joined
- Feb 6, 2005
I have a problem...
I'm trying to write a bash script to compare $1
I want the first argument to be the "options" eg. script -d
so here is what i tried
if [$1 == -*]
it doesn't seem to give me the results i want. It "should" tell me whether the first character of the first positional parameter is a hyphen, but it doesn't seem to do that.
Does anyone know how to get that working right?
I'm trying to write a bash script to compare $1
I want the first argument to be the "options" eg. script -d
so here is what i tried
if [$1 == -*]
it doesn't seem to give me the results i want. It "should" tell me whether the first character of the first positional parameter is a hyphen, but it doesn't seem to do that.
Does anyone know how to get that working right?