Clean way to bring back background process to foreground in shell script
9
votes
1
answer
5560
views
As an example:
I have working shell script which starts up weblogic (which will continue to run) and then do deployment
At the end I bring background process back to foreground, so that shell script does not exit (Exited with code 0)
#!/bin/bash
set -m
startWebLogic.sh &
# create resources in weblogic
# deploy war
# ...
jobs -l
fg %1
I had to use
set -m
, to allow job control, but I also found it is not cleaniest way to use it in non-interactive shells.
Is there a better way to handle it?
Asked by Patrik MihalĨin
(245 rep)
Nov 25, 2016, 01:11 PM
Last activity: Nov 25, 2016, 02:24 PM
Last activity: Nov 25, 2016, 02:24 PM