I'm not a big fan of nohup (I use disown instead), but if you put ‘nohup’ in front of each command in a shell script it will accomplish the nohup part of your question.
However, I think your files are SAS programs? If you want SAS run in parallel on each SAS program:
nohup sas test1_2.sas &
nohup sas test3_4.sas &
That will run independent ...
I needed something like this for running expect scripts from an automated test system (Jenkins). Expect automatically closes stdout when it detects EOF on stdin, and that causes all writes to stdout to fail and terminate the test. I worked around it by simply making its stdin /dev/zero.
Just using nohup without any redirection the file nohup.out is written in append mode.
That's why the truncation of the file after inspection by the command
sets the file to length zero and subsequent output of the program is written to nohup.out at the start of the file.
That is exactly what the above answer to the question told - and it ...
I think you are trying to get any messages from nohup itself into nohup2.out, but the & async ends the whole command, and the final redirect would just empty the file.
This seems to work. I closed the originating shell, then tried kill -HUP and kill -INT, both of which it survived.
nohup >nohup2.out 2>&1 bash -c 'tail -f mylog.log > ...
Your code does not make sense.
If you want to redirect the stdin and stderr channels, then you will use this:
nohup tail -f mylog.log > ./messages.log 2> ./errors.out
If you want all messages to go into one file, you'd use:
nohup tail -f mylog.log > all_messages.txt 2>&1
If you want to duplicate the messages, you'd use:
nohup tail -f ...