[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] New Hobbit "admin" Scripts
- To: hobbit <hobbit (at) hswn.dk>
- Subject: Re: [hobbit] New Hobbit "admin" Scripts
- From: Michael Nemeth <michael.nemeth (at) lmco.com>
- Date: Fri, 22 Dec 2006 09:03:43 -0500
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
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/
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++