On Tue, Nov 16, 2004, Michael Schloh wrote:

>   -    ntp_pidfile="@l_prefix@/var/ntp/ntpd.pid"
>   +    ntp_pidfile=`grep "^pidfile" @l_prefix@/etc/ntp/ntp.conf | sed -e 
> "s;[^ ^t]*[ ^t]*\(.*\)$;\1;"`

Unfortunately there are three problems: the "^t" escape for a tab
character in a sed(1) regex is not sufficiently portable, the
backslashes in the sed(1) command would have to be escaped against
the surrounding double-quotes and the capturing regex also would
capture trailing whitespaces. I see no portable and at the same time
generic enough way to solve this with sed(1). Instead awk(1) works far
more reasonable here, hence I've fixed it with the construct: awk '{
printf("%s", $2); }'
                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to