OK I got it to work. Changed : this_getQuery() {
RETURN=`echo "$1" | $GREP -oE "(^|[?&])$2=[^&]+" | $SED
"s/%0D//g"| $SED "s/%0A/\n/g"
| $CUT -f 2 -d "=" | $SED "s/%3D/=/g" RETURN=echo "$1" | awk -F\= '{print $2}' | $SED "s/%3D/=/g"`
}
What are you trying to do with all the grep and sed?
BTW is almost always better (more portable?) to use awk -F rather than cut -f cut is "white space challenged " on many systems
Also it Bash level dependent! Works: GNU bash, version 2.05.0(1)-release (sparc-sun-solaris2.8) Does work:GNU bash, version 2.03.0(1)-release (sparc-sun-solaris)
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| _p_ Mike Nemeth
| ___| |_____ email(w) michael.nemeth at lmco.com Work: 856 359-1425
|><___________) | Home Page:http://www.geocities.com/mjnemeth/
| Work Page:http://scorpion/~nemethm/
| Work Page:http://ortfsb/~mnemeth/
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Hi, thx for your work!
But on your solution there is one Problem, becouse it only work if you have only 1 variable to send in most of this scripts i used more. I have used this solution without cut, awk, grep i hope it works. You can download it heer:
http://www.fh-augsburg.de/~henk/hobbit/
it is Version 0.0.7 with this change.
this_getQuery()
{
RETURN=echo "$1" | $SED -n "s/^.*$2=\([^&]*\).*\$/\1/p" | $SED "s/%0D//g"| $SED "s/%0A/\n/g" | $SED "s/%3D/=/g"
}
The many sed is needing because cgi converts some Characters in "%ASCI" and noone have given me an small solution, so i reconvert every Ascii value manually. Its not beatyfull but it works (i hope so ;-) )
I hope i could help you Stefan
Hi, Stefan !
Thanks, now it works ....
Great !
Cheers & have a happy new year
Martin
Martin Flemming DESY / IT office : Building 2b / 008a Notkestr. 85 phone : 040 - 8998 - 4667 22603 Hamburg mail : martin.flemming at desy.de
On Wed, 27 Dec 2006, stefan.freisler at aspect-online.de wrote:
Hi, thx for your work!
But on your solution there is one Problem, becouse it only work if you have only 1 variable to send in most of this scripts i used more. I have used this solution without cut, awk, grep i hope it works. You can download it heer:
http://www.fh-augsburg.de/~henk/hobbit/
it is Version 0.0.7 with this change.
this_getQuery() { RETURN=
echo "$1" | $SED -n "s/^.*$2=\([^&]*\).*\$/\1/p" | $SED "s/%0D//g"| $SED "s/%0A/\n/g" | $SED "s/%3D/=/g"}The many sed is needing because cgi converts some Characters in "%ASCI" and noone have given me an small solution, so i reconvert every Ascii value manually. Its not beatyfull but it works (i hope so ;-) )
I hope i could help you Stefan
participants (3)
-
martin.flemming@desy.de
-
michael.nemeth@lmco.com
-
stefan.freisler@aspect-online.de