From d383901d8e2c5199aed5f6daff8dbb28ef728741 Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 25 Sep 2019 00:57:10 -0500 Subject: [PATCH] fork: Add a utility to fork a task to bg --- fork | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 fork diff --git a/fork b/fork new file mode 100755 index 0000000..46f0bfc --- /dev/null +++ b/fork @@ -0,0 +1,18 @@ +#! /bin/sh +# +# fork +# Fork a task to bg without terminal spew +# Copyright (C) 2019 Vintage Salt +# +# Distributed under terms of the MIT license. +# + + +if [ -z "$@" ]; then + printf "$0: requires argument\\n" +fi +( +exec 0>/dev/null 1>&0 2>&0 "$@" +)& +disown +exit 0