]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/jobs1.sub
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / jobs1.sub
1 # make sure that jobs -p, %+, and $! all agree
2 set -m
3 sleep 60 &
4
5 FN=/tmp/jobs-pid.$$
6
7 pid1=$!
8 jobs -p %+ > $FN
9 pid2=$(< $FN)
10 rm $FN
11
12 if [ $pid1 -ne $pid2 ]; then
13 echo 'oops - $! and jobs -p %+ disagree!'
14 fi
15
16 exec 2>/dev/null
17 kill -9 $pid1