daemontools-encore
daemontools-encore copied to clipboard
Portability fix: Avoid the use of sed -r
Legacy sed does not support -r option (use extended regular expressions)
Another option: according to GNU sed's manpage, -E
is the POSIX-specified and portable synonym for -r
. This seems to work for me on a bunch of platforms:
@@ -20,8 +20,8 @@ svpid=$!
waitok test.sv
svstat test.sv \
-| sed -r 's, \(.+\),,' \
-| sed -r 's, ([0-9]|1[0-9]) second.+$, ok,'
+| sed -E 's, \(.+\),,' \
+| sed -E 's, ([0-9]|1[0-9]) second.+$, ok,'