Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
25f589b2ce
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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`
     }