I have a script to process records in some files, it usually takes 1-2 hours. When it's running, it prints a progress of number of records processed.
Now, what I want to do is: when it's running with nohup
, I don't want it to print the progress; it should print progress only when it run manually.
My question is how do I know if a bash script is running with nohup
?
Suppose the command is nohup myscript.sh &
. In the script, how do I get the nohup
from command line? I tried to use $0
, but it gives myscript.sh
.