Skip to content

Instantly share code, notes, and snippets.

@mlsteele
Created July 22, 2016 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlsteele/5b0162fc713becd938c278dd283e4aef to your computer and use it in GitHub Desktop.
Save mlsteele/5b0162fc713becd938c278dd283e4aef to your computer and use it in GitHub Desktop.
Detach and silence output while running.
#!/bin/sh
# Run a process silenced and disowned.
# Example Usage: ds firefox
if test -t 1; then
exec 1>/dev/null
fi
if test -t 2; then
exec 2>/dev/null
fi
"$@" &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment