Преглед на файлове

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.

Ralf S. Engelschall преди 21 години
родител
ревизия
25f589b2ce
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      ntp/rc.ntp

+ 1 - 1
ntp/rc.ntp

@@ -13,7 +13,7 @@
     ntp_log_complevel="9"
 
 %common
-    ntp_pidfile=`grep "^pidfile" @l_prefix@/etc/ntp/ntp.conf | sed -e "s;[^ ^t]*[ ^t]*\(.*\)$;\1;"`
+    ntp_pidfile=`grep "^pidfile" @l_prefix@/etc/ntp/ntp.conf | awk '{ printf("%s", $2); }'`
     ntp_signal () {
         [ -f $ntp_pidfile ] && kill -$1 `cat $ntp_pidfile`
     }