LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 04-28-2011, 06:30 PM   #1
Shao Lung
Member
 
Registered: Apr 2011
Posts: 71

Rep: Reputation: 0
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
 
Old 04-28-2011, 06:35 PM   #2
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 875

Rep: Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819Reputation: 1819
Quote:
Originally Posted by shao Lung View Post
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.
 
1 members found this post helpful.
Old 04-28-2011, 06:47 PM   #3
GazL
Senior Member
 
Registered: May 2008
Posts: 3,477

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You might also want to look at the man page for bash and check out the section on 'SIGNALS' and the 'disown' command.
 
Old 04-28-2011, 06:55 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
May be serious overkill for your purposes, but also check out 'GNU screen' and 'tmux'.
 
1 members found this post helpful.
Old 04-28-2011, 06:59 PM   #5
Shao Lung
Member
 
Registered: Apr 2011
Posts: 71

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by anomie View Post
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 ?
 
Old 04-28-2011, 07:26 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Yes, and I've used it for both purposes.
 
Old 04-28-2011, 07:33 PM   #7
Shao Lung
Member
 
Registered: Apr 2011
Posts: 71

Original Poster
Rep: Reputation: 0
Thank you everyone,,, solved.
 
  


Reply

Tags
bash, disown, nohup, screen


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash code design rejeep Programming 8 08-15-2007 10:36 AM
Doubt with a bash code linuxlover1234 Programming 10 03-30-2004 01:48 PM
stripping of bash code? Lindows45 Linux - Newbie 2 03-01-2004 08:51 AM
where is the bash source code?... gearoid Programming 5 11-25-2003 05:24 AM
Bug in c code calling bash code Linh Programming 11 08-12-2003 05:27 AM


All times are GMT -5. The time now is 11:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration