Commit 2e4016aa authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: fix selftester.sh script (lines starting with a space)

parent dc3d2caa
......@@ -31,6 +31,11 @@ ps_children () {
ps -e -o pid -o command=COMMAND-WIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIDE-COLUMN -o ppid | grep " $1$" | grep -v -e ' grep ' -e ' ps -e '
}
# get the pid field from the output line of ps_children
get_pid() {
echo "$1" | grep -E -o '[0-9]+' | head -n 1
}
# nb_report_lines( ) : get number of lines in report
nb_report_lines () {
report_lines="$(wc -l selftest_report.log)"
......@@ -127,12 +132,12 @@ for app in $OTB_APPS; do
nb_try=0
while [ -z "$NEXT_CHILD_PID" -a $nb_try -lt 10 ]; do
sleep 1s
CHILD_PROC=$(ps_children $GUI_PID | grep "bin/otbgui $app")
CHILD_PROC=$(ps_children $GUI_PID | grep " bin/otbgui $app")
if [ -n "$CHILD_PROC" ]; then
CHILD_PID=$(echo "$CHILD_PROC" | cut -d ' ' -f 1)
CHILD_PID=$(get_pid "$CHILD_PROC")
NEXT_CHILD_PROC=$(ps_children "$CHILD_PID" | grep 'otbApplicationLauncherQt')
if [ -n "$NEXT_CHILD_PROC" ]; then
NEXT_CHILD_PID=$(echo "$NEXT_CHILD_PROC" | cut -d ' ' -f 1)
NEXT_CHILD_PID=$(get_pid "$NEXT_CHILD_PROC")
fi
fi
nb_try=$(( nb_try + 1 ))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment