05-15-04 07:34 PM
I know I am missing something really trivial here. I've been away from
shell scripting over the years, for the most part been working with the
likes of Perl, C++, and Java, and I seem to have forgotten some aspect
of shell programming it seems thats biting me in the arse, when I wanted
to write an utterly simple script to save me some time.
sendcmd:
1 #!/bin/sh
2
3 CMD="./sendcommand blah 127.0.0.1 2701 '$*'"
4 echo -n "CMD: $*"
5 echo
6 $CMD
7 echo
Say I run it like this, the echo looks fine
$ ./sendcmd do this
CMD: do this
but sendcommand ask as if no params were passed. If I remove the ''
around $* on line 3, then it works, but I need literal single quotes
aroudn the params being pased, so to allow spaces. I wanted to use $* so
I don't have type any surrounding quotes when I use my script, and have
the script put singles around that. (Notice I didnt put any '' around
"do this" on the command line.
Thanks.
--
Trent Curry - trentcurryREM0VE@hotmail.com
perl -e
'($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h
2",$1
)!eg;print(reverse("$s")."\n");'
[ Post a follow-up to this message ]
|