09-21-2004
300,
1
Join Date: Aug 2003
Last Activity: 11 January 2018, 3:23 AM EST
Location: Ireland
Posts: 300
Thanks Given: 2
Thanked 1 Time in 1 Post
thanks for your reply... I found something very useful yesterday to use as a function as it sets the variables perfectly:
{
VFLAG="0"
[[ "_${1}" = "_-v" ]] && VFLAG="1"
CGI_TMP1=`sed -e "s/\&/ /g;s/%\(..\)/\\\`print \\\'ibase=16\\\; \1\\\' \\\| bc \\\| awk \\\'\\\{printf\\\(\\\\\"%c\\\\\",\\\$1\\\)\\
\}\\\'\\\`/g"`
if [[ "_${CGI_TMP1}" != "_" ]]
then
for i in `eval echo "\"${CGI_TMP1}\""`
do
CGI_TMP2=`print "${i}" | sed -e "s/\"/\'/g;s/,/ /g;s/+/ /g"`
CGI_VAR="${CGI_TMP2%%=*}"
CGI_VAL="${CGI_TMP2#*=}"
eval ${CGI_VAR}="\"\${CGI_VAL}\""
[[ ${VFLAG} -eq 1 ]] && print "${CGI_VAR}=\"${CGI_VAL}\""
done
fi
}