[pass] [PATCH v2] clip: don't race between pass instances in restore

Jason A. Donenfeld Jason at zx2c4.com
Sat Mar 22 07:22:17 CET 2014


On Thu, Mar 20, 2014 at 7:57 AM, Matthew Cengia <mattcen at gmail.com> wrote:
> On 2014-03-21 00:54, Matthew Cengia wrote:
> [...]
>>   while read -r pid cmd; do [[ $cmd = $sleep_argv0* ]] && kill -9
"$pid"; done < <(ps -opid=,args= -u"$(id -u)") && sleep 0.1
>

What do you make of this one?

- kill -9 $(grep -l -r --include="cmdline" "^$sleep_argv0" /proc/
2>/dev/null | sed -n 's:/proc/\([0-9]\+\)/.*:\1:p' | sort | uniq)
2>/dev/null && sleep 0.1
+ pkill -f "^$sleep_argv0" && sleep 0.1

Super simple.

Looks like OSX and FreeBSD both have pkill too:
http://www.freebsd.org/cgi/man.cgi?query=pkill&sektion=1 and
https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/pkill.1.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140322/73c2b4fe/attachment.html>


More information about the Password-Store mailing list