PID=$(sed -n 's/^\s*pid\s\s*\([^;]*\).*/\1/p' /etc/nginx/nginx.conf)
works for the three testcases shown in this and linked bugs.
not sure why I cant use \s+ after pid in the expression above, but it works this way.
PID=$(sed -n 's/^\s* pid\s\s* \([^;]* \).*/\1/ p' /etc/nginx/ nginx.conf)
works for the three testcases shown in this and linked bugs.
not sure why I cant use \s+ after pid in the expression above, but it works this way.