Fix for issue .

Introduces a new function in helper_lib.sh to query the command line
arguments of the running instances of a binary. This is done to get
rid of the problem of "-lf" versus "-alf" for pgrep.

Signed-off-by: Joachim Lusiardi <joachim@lusiardi.de>
This commit is contained in:
Joachim Lusiardi 2015-06-22 21:36:56 +02:00 committed by Joachim Lusiardi
parent 62a903246c
commit fc8eefb8a6
2 changed files with 21 additions and 10 deletions

View file

@ -36,3 +36,13 @@ contains() {
return 1 # $substring is not in $string
fi
}
# Extracts all commandline args from all running processes named like the first parameter
get_command_line_args() {
PROC="$1"
for PID in `pgrep $PROC`
do
cat /proc/$PID/cmdline | tr "\0" " "
done
}