Public bug reported: I had my own version of the exit function declared in one of my shell startup files. It worked in bash and zsh, but not in /bin/sh on Ubuntu.
Adding to the problem, it seems GDM uses /bin/sh inspite of my shell being /bin/zsh. $ cat exittest #!/bin/sh exit() { case $- in *m*) # this way works in bash and zsh jobs | wc -l | grep -q '^0$' if test $? -eq 0 then command exit "$@" else jobs fi esac } exit $ ./exittest ./exittest: 3: Syntax error: Bad function name $ dpkg -S /bin/sh diversion by dash from: /bin/sh diversion by dash to: /bin/sh.distrib bash: /bin/sh $ dpkg -l dash | grep '^i' ii dash 0.5.4-9ubuntu1 POSIX-compliant shell ** Affects: dash (Ubuntu) Importance: Undecided Status: New -- can't define custom exit function https://bugs.launchpad.net/bugs/301225 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