aboutsummaryrefslogtreecommitdiff
path: root/shellrc.d/function
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2018-09-24 15:37:59 +0200
committerKarel Kočí <karel.koci@nic.cz>2018-09-24 15:37:59 +0200
commitc4fd9f7dac80b1bcd32d7dff39b0bbc9182002fa (patch)
tree052da23baa254ddcec38689207a7de6fda0ebdec /shellrc.d/function
parenta55cffa8b3cbc02e2b021ed25e67203d337c36bb (diff)
downloadshellrc-0.5.3.tar.gz
shellrc-0.5.3.tar.bz2
shellrc-0.5.3.zip
Improve tobg and rename it to tbgv0.5.3
Diffstat (limited to 'shellrc.d/function')
-rw-r--r--shellrc.d/function5
1 files 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)