Executing a script with nohup

Hi,

Is there any way to achieve that my script should always execute like:

 nohup ./scriptname >nohup.out & 

even if i execute

 ./scriptname

, it should be converted to

 nohup ./scriptname >nohup.out & 

and then execute.

How i can achieve this?

Thanks in advance

If you need the functionality of nohup , you could set a trap for SIGHUP to ignore it and ensure required redirections.

1 Like

Hi, Could you please explain/show some related examples?

Thanks