claudio schwarz purzlbaum kaxleb7obdk unsplash 2

Suppose you want to to start an XWindow program from a terminal with its input, output, and error output redirected to null (/dev/null). Moreover you want the started program not to be hit with SIGHUP signal and exited when you close the terminal window from which you’ve started it:

x glxgears

It can be done with the following script:


if ! { which "$cmd" > /dev/null; }; then
    echo "x: $cmd not found."
    "$@" >/dev/null 2>&1 &

Well, somebody make Debian and .rpm packages with this short script.


Leave a Reply

Your email address will not be published. Required fields are marked *