Start the command as a background task, with &
at the end:
nohup path_to_domain_bin/startWebLogic.sh>/dev/null < /dev/null 2>&1 &
The output redirections are not helping much, as nohup
redirects the output anyway, as you have noticed. To get rid of that, skip nohup
and do what it does (rather, the essential part of it) in the script yourself:
trap "" 1 # catch hangup signal
path_to_domain_bin/startWebLogic.sh>/dev/null < /dev/null 2>&1 &
But I have an uneasy feeling with completely discarding the information that calling the program may give you. This way, you wouldn't even get an error if the called pathname is wrong!
I usually append such output to a log file, including a bit of additional information, like this:
(
LOGFILE=/var/log/weblogic_start.log
trap "" 1 # catch hangup signal
exec 1>> $LOGFILE # redirect output a bit more readably
exec 2>> $LOGFILE
exec < /dev/null
path_to_domain_bin/startWebLogic.sh &
date "+%Y%m%d:%H%M%S weblogic started with PID $!"
)
The exec
redirects are a bit more readable, which pays off in a script IMO; besides, the date
call gets redirected, too. Running this in a subshell (...)
makes sure the effect of the redirects is kept to this part of the script.