2013-11-14 17:56:51 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ $# -eq 0 ] || [ "$1" = "-h" ]; then
|
2014-11-12 16:15:39 +01:00
|
|
|
cat<<EOF
|
2013-11-14 17:56:51 +01:00
|
|
|
Usage: ${0##*/} PROCESS-EXP
|
|
|
|
|
|
|
|
Extended pgrep -a
|
|
|
|
|
|
|
|
EOF
|
2014-11-12 16:15:39 +01:00
|
|
|
exit
|
2013-11-14 17:56:51 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
for i ; do
|
2014-11-12 16:15:39 +01:00
|
|
|
## We need to store the result of 'ps' first to prevent the filtering from
|
|
|
|
## appearing in the result.
|
|
|
|
BUF="$(ps aux)"
|
|
|
|
echo "$BUF" | awk -v pid=$$ -v pattern="$i" '$2 != pid && $0 ~ pattern'
|
2013-11-14 17:56:51 +01:00
|
|
|
done
|