Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Process doubled?

3 views
Skip to first unread message

kod...@gmail.com

unread,
Jul 30, 2018, 5:00:14 AM7/30/18
to
When executing this script

#!/bin/bash
/usr/bin/pgrep -f `/usr/bin/basename $0` && echo OK
echo $$


$$ gets written twice, as confirmed by
./proc.sh | grep '[[:digit:]]'
(assuming the script has been saved under the file proc.sh)

Expected behavior = $$ should be echoed only once.

Anyone else seeing this?
Is this normal?

kod...@gmail.com

unread,
Jul 30, 2018, 5:08:15 AM7/30/18
to
Yes it is.
The first $$ is printed by pgrep.
Please disregard.
Thank you.
0 new messages