Why won't my bash script exit after execution?

view story

http://unix.stackexchange.com – I compiled a short bash one-liner to focus a running application or launch it if it isn't running: #!/bin/bash #intellilaunch.sh wmctrl -a $1 || $1 & disown exit 1 The command exits perfectly fine when run directly from the command line: :~$ wmctrl -a firefox || firefox & disown [1] 32505 A quick check with the system monitor shows that only firefox is running. However, when I launch firefox via the script (./intellilaunch.sh firefox) it spawns a persisting new process called intellilaunch.sh firefox, which only exits after closing firefox. What am I doing wrong? Edit: I mo (HowTos)