Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: dash (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to dash in Ubuntu.
https://bugs.launchpad.net/bugs/673119

Title:
  dash "set -e" breaks "trap action INT"

Status in dash package in Ubuntu:
  Confirmed

Bug description:
  Binary package hint: dash

  With set -e, dash executes only the first command of an INT (Ctrl-C)
  trap handler:

  #!/bin/sh
  set -e

  trap 'sorry' INT
  trap 'echo EXIT' EXIT

  zero() {
    return 0;
  }

  sorry() {
    #zero
    echo "Ignored 1"; echo "Ignored 2"
    sleep 1
    echo Back
  }

  for i in 3 2 1; do
      echo "$i"
      sleep 1 # || true
  done

  echo OUT

  Actual result:

  $ ./x  # Press ^C right away
  3
  ^CIgnored 1
  EXIT

  Expected result:

  3
  ^CIgnored 1
  Ignored 2
  Back
  2
  1
  OUT
  EXIT

  By un-commenting the call to function zero, or the "|| true" in the
  main loop, the problem disapears.

  Bash also exits prematurely, but at least it runs the "trap INT"
  handler code to completion.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: dash 0.5.5.1-3ubuntu2
  ProcVersionSignature: Ubuntu 2.6.32-25.45-generic 2.6.32.21+drm33.7
  Uname: Linux 2.6.32-25-generic i686
  NonfreeKernelModules: nvidia
  Architecture: i386
  Date: Tue Nov  9 19:12:41 2010
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: dash

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/673119/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to