Public bug reported:

Binary package hint: dash

The problems with making /bin/sh symlink to dash instead of bash are
known (#141481), but I haven't seen this particular problem reported
yet.

dash and bash process the ^C (INT) signal differently.  Try running the
following script (then type ^C) with both bash and dash:

<<<
tint() { echo int; }
thup() { echo hup; }
tchld() { echo chld; }
tterm() { echo term; }
texit() { echo exit; }

# trap tint INT
trap thup HUP
trap tchld CHLD
trap tterm TERM
trap texit EXIT

echo type ^C...
sleep 100
>>>

bash triggers the EXIT.  dash triggers no trap.

If you uncomment the INT trap, bash triggers INT and EXIT, and dash
triggers INT, CHLD, and EXIT.

I don't know what POSIX dictates or which is correct, I am guessing that
any exit should trigger EXIT (so dash is wrong).

Either way, the shells behave differently, and the difference is causing
problems in existing Ubuntu scripts.  (I found it in /usr/bin/xeno-
test.)

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: dash 0.5.5.1-3ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-23.37-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-23-generic i686
Architecture: i386
Date: Thu Jul 22 15:12:27 2010
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: dash

** Affects: dash (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 lucid

-- 
dash does not handle ^C trap the same way that bash does
https://bugs.launchpad.net/bugs/608894
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to