2 # BASH VERSION OF nohup COMMAND
6 path
=$
(builtin type -p $cmd |
sed 1q
)
7 if [ -n "$path" ]; then
12 */*) [ -x "$cmd ] && { echo "$cmd" ; return 0; } ;;
13 *) case "$
(builtin type -t $cmd)" in
15 *) echo "$cmd" ; return 0;;
22 trap '' HUP # ignore hangup
25 umask u=rw,og= # default mode for nohup.out
26 exec 0< /dev/null # disconnect input
27 if [ -t 1 ]; then # redirect output if necessary
29 echo 'Sending output to nohup.out'
31 else echo "Sending output to
$HOME/nohup.out
"
32 exec >> $HOME/nohup.out
38 # direct unit 2 to a file