[FreeNX-kNX] nxserver low performance when querying sessions (patch included)
Boris Savelev
boris.savelev at gmail.com
Wed Jul 29 17:16:45 UTC 2009
2009/7/29 Mario Becroft <mb at gem.win.co.nz>:
> Boris Savelev <boris.savelev at gmail.com> writes:
>
>>> @@ -26,9 +26,9 @@
>>>
>>> # Reread boot command line; echo last parameter's argument or return false.
>>> getparam(){
>>> -stringinstring "&$1=" "$CMDLINE" || return 1
>>> -echo "$CMDLINE" | tr "&" "\n" | egrep "^"$1"=" | awk -F= '{ VAL=$2 } END { print VAL }'
>>> -return 0
>>> + [[ "&$CMDLINE" =~ ".*&$1=([^&]*)" ]]
>>> + echo ${BASH_REMATCH[1]}
>>> + [ "$BASH_REMATCH" != "" ]
>>> }
>>
>> it doesnt works for me
>>
>> but
>> <cut>
>> getparam(){
>> pattern=".*&$1=([^&]*)"
>> [[ $CMDLINE =~ $pattern ]]
>> [ "${BASH_REMATCH[1]}" != "" ] && echo "${BASH_REMATCH[1]}"
>> [ "$BASH_REMATCH" != "" ]
>> }
>> <cut>
>> works fine
>
> My mistake, I forgot to quote ${BASH_REMATCH[1]} (although here, it
> works fine anyway).
>
> It was intentional that it always echos the result even if empty, even
> though this behaviour is different to the original behaviour. However
> your version is also different to the original. I think maybe you meant:
>
> [ "$BASH_REMATCH" != "" ] && echo "${BASH_REMATCH[1]}"
>
> which should achieve the original behaviour of not echoing anything when
> the parameter does not exist. I was trying to keep it as simple as
> possible, and I found that it worked anyway so I didn't bother with
> this.
hmmm.
ok.
but I get problem like this ->
http://lists.opensuse.org/opensuse-bugs/2008-11/msg04200.html
Remove the double quotes from
[[ "&$CMDLINE" =~ ".*&$1=([^&]*)" ]]
help me-)
--
Boris
More information about the FreeNX-kNX
mailing list