LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   bash code (https://www.linuxquestions.org/questions/slackware-14/bash-code-877703/)

Shao Lung 04-28-2011 05:30 PM

bash code
 
I've noticed something, and hoped there was a work around.
when I write a simple bash script, and run it, if I close the terminal i ran the bash script inside, the bash script stops. What are the solutions for this? Basically I want to run my bash script and close the terminal, keep the bash script running.

thanks in advance

volkerdi 04-28-2011 05:35 PM

Quote:

Originally Posted by shao Lung (Post 4339922)
I've noticed something, and hoped there was a work around.
when I write a simple bash script, and run it, if I close the terminal i ran the bash script inside, the bash script stops. What are the solutions for this? Basically I want to run my bash script and close the terminal, keep the bash script running.

thanks in advance

Check out the "nohup" command.

GazL 04-28-2011 05:47 PM

You might also want to look at the man page for bash and check out the section on 'SIGNALS' and the 'disown' command.

anomie 04-28-2011 05:55 PM

May be serious overkill for your purposes, but also check out 'GNU screen' and 'tmux'.

Shao Lung 04-28-2011 05:59 PM

Quote:

Originally Posted by anomie (Post 4339953)
May be serious overkill for your purposes, but also check out 'GNU screen' and 'tmux'.

I think it was screen that i used to use for running scripts via ssh,,,, technically this should work at the terminal as well ?

anomie 04-28-2011 06:26 PM

Yes, and I've used it for both purposes.

Shao Lung 04-28-2011 06:33 PM

Thank you everyone,,, solved.


All times are GMT -5. The time now is 10:28 PM.