I have a bash script that will run in both Linux and Mac OS X. One particular line of the script works as is in Linux, but not in OS X.
nohup <utility> <arg> > output.txt 2> error.txt </dev/null &
When the bash script runs in Linux, it works like a charm. However, running the bash script in OS X, I get the error
nohup: can't detach from console: Inappropriate ioctl for device
I've done a lot of searching and haven't found a suitable answer as to why this is behaving as such.
The executing script exits long before the <utility>
, which is why (as far as my knowledge goes) I need to use nohup
. However, I've done some testing, and removing nohup
from the line in the bash script seems do the trick in that the utility on both systems will launch, and continue to run even after the script exits.
try this :
nohup <utility> <arg> > output.txt 2> error.txt >/dev/null &
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With