Public bug reported: pgrep could get confused when the command contains regular expressions that match the run-* command itself, e.g. an argument like "run-this-one foo 'a|b'"
PR at https://github.com/dustinkirkland/run-one/pull/1 ----- Copied from PR (formatting suffers) ----- $ cat /tmp/sleepforever #!/bin/bash echo Sleeping for 99 days... sleep +99d # version in HEAD $ run-this-one /tmp/sleepforever Sleeping for 99 days... <ctrl-c> $ run-this-one /tmp/sleepforever "a|b" Terminated Run with -x you find the problem is this: + base=run-this-one + ps=/tmp/sleepforever a|b + pgrep -u wbagg -f ^/tmp/sleepforever a|b$ + kill 768759 Terminated pgrep is matching our run-this-one command and itself. The $$ check verifies that we don't kill run-this-one, the ps addition assures we don't kill the (no longer running) pgrep. ** Affects: run-one (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2081328 Title: run-this-one fails on commands that include some regex patterns To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/run-one/+bug/2081328/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
