Quote:
Originally Posted by
RudiC
Don't mix the external variables definition -vfor awk with YOUR function's -v option for the SW version!
1) You need some mechanism to pass your version (sub-) string to the awk script.
2) Why? What advantages do you expect from that?
3) Although by tricky quoting and other wizardry you might be able to do that, it generally is not recommended as it may break any time, should e.g. the awk and/or shell version change.
What makes you believe the actual setup doesn't satisfy your needs? If you don't like the irrelevant second parameter, drop it and supply the version in $2 instead. Or, as drl proposed, validate it is -v and print an error message if it's not.
It does and doesn't satisfy my needs. Everything works fine as is, I'd just prefer to assign
-v|veras the only things that can initiate the search of the software version, not anything in
$3. Again, it's just my own personal preference, and I've already implemented my own work around in
-h|helptelling the user to use
-vto do this.
The things I threw out were just things floating in my head to try to force
-v|ver. Since I'm very new to this whole scripting/programming in shells, I'm going to throw out things that don't make sense entirely. It's my hope that whatever I'm thinking can be translated by someone who knows and then can point me in the right direction, which has happened.
Thanks guys! I'm still reading into all of this and will try my hand at it once I have a better grasp of what drl has suggested.