[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
commands do not ignore TSTP if TSTP ignored already
From: |
idallen |
Subject: |
commands do not ignore TSTP if TSTP ignored already |
Date: |
Thu, 16 Oct 2014 00:38:23 -0400 (EDT) |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib
-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Wformat-security -Werror=format-security -Wall
uname output: Linux idallen-oak.home.idallen.ca 3.13.0-37-generic
#64~precise1-Ubuntu SMP Wed Sep 24 21:37:11 UTC 2014 x86_64 x86_64 x86_64
GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 4.2
Patch Level: 25
Release Status: release
Description:
If a bash shell script starts up with TSTP ignored, commands run by that
script will not ignore TSTP, even if you set a trap in the script to
ignore TSTP. If the script starts up with TSTP not ignored, then the
trap to ignore TSTP works fine.
Repeat-By:
Create these two scripts below one.sh and two.sh and run ./one.sh and use
^Z to signal TSTP. The "sleep" will stop, even though TSTP is ignored.
Remove (comment out) the "trap" line from one.sh and run ./one.sh and
now ^Z (TSTP) is properly ignored when two.sh runs.
==> one.sh <==
#!/bin/bash
trap '' TSTP
exec ./two.sh
==> two.sh <==
#!/bin/bash
trap '' TSTP
while : ; do
echo "DEBUG"
sleep 1
done
- commands do not ignore TSTP if TSTP ignored already,
idallen <=