From c4fd9f7dac80b1bcd32d7dff39b0bbc9182002fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 24 Sep 2018 15:37:59 +0200 Subject: Improve tobg and rename it to tbg --- shellrc.d/function | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shellrc.d/function b/shellrc.d/function index 56e648a..06a36fd 100644 --- a/shellrc.d/function +++ b/shellrc.d/function @@ -1,8 +1,9 @@ # vim: ft=sh: # Run process in background -tobg() { - "$@" >/dev/null 2>&1 & +tbg() { + mkdir -p /tmp/tbg-log + nohup "$@" >/dev/null >/tmp/tbg-log/$0-$(date +%g%m%d%H%M%S%N) & } # Generate random password (optionally takes length of password as first argument) -- cgit v1.2.3