LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-23-2010, 07:16 PM   #16
Slightly Disoriented
Member
 
Registered: Sep 2010
Distribution: Ubuntu 10.10
Posts: 87

Original Poster
Rep: Reputation: 2

Mmmm, that script all worked... Thank you! Sorry for all the confusion, but thank you for the help, all of you! I do have one more question:
Quote:
Is there a way to have the script launch when I start my GNOME session. Like, to where there is a terminal open asking the first question when I'm logged in?
 
Old 11-23-2010, 07:38 PM   #17
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
I'm glad it's working. Do some comparison with what's in it versus what wasn't working on your end. It might explain some things or give you some new ideas.

As for the other question, yes, you can launch it automatically when you log in. In the desktop, use the top menu bar and select:
System -> Preferences -> Startup Applications

In the window that opens, click the "Add" button

In the new window that opens, put the following information in each field:
Name: This can be anything; It's just used to label the command
Command: What you would execute at the terminal. Use full paths just to be safe (for example: "/bin/bash /home/username/startup_script.sh" )
Comment: More text to describe what the program does--in case the label doesn't jog your memory

Then click the "Add" button.

You should now see a new entry in the list of startup programs that includes your script.

Last edited by Dark_Helmet; 11-23-2010 at 08:17 PM. Reason: oh my word... I should proofread sometimes before clicking "submit"
 
Old 11-25-2010, 12:46 PM   #18
Slightly Disoriented
Member
 
Registered: Sep 2010
Distribution: Ubuntu 10.10
Posts: 87

Original Poster
Rep: Reputation: 2
Okay, I know I made this thread solved, but I realized a problem. The script does work when I start Ubuntu, but when it is all through it shuts off the terminal killing Chrome, Thunderbird, etc... How to I make this stop, or make it where they aren't dependent, per say, on if the terminal is open? I made some changes to the script, so the one I'm working with is attached. At the end you'll notice I added "Would you like to kill the terminal?" and no matter what I put, even no, it closes, but I think that's not because the if is wrong, I think it's because the terminal is sensing the end of the script.
Attached Files
File Type: txt Main.txt (2.1 KB, 6 views)

Last edited by Slightly Disoriented; 11-25-2010 at 12:47 PM.
 
Old 11-25-2010, 12:58 PM   #19
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Since using bash, maybe try one of the following methods of starting things from your script:
Instead of:
Code:
google-chrome &
try one of:
Code:
google-chrome & disown
# or
nohup google-chrome & disown
The former disowns the google-chrome process from the spawning terminal, and the latter goes further by using `nohup` on the chrome, making it resistant to HUP (hang up) signals. You may not want or need that, so try the first method first.

Note that `disown` may be bash only; I do not believe the command exists in (all) other shells.

Good luck!
 
Old 11-25-2010, 05:07 PM   #20
Slightly Disoriented
Member
 
Registered: Sep 2010
Distribution: Ubuntu 10.10
Posts: 87

Original Poster
Rep: Reputation: 2
I tried both of those and they didn't work... Any suggestions?
 
  


Reply


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 Scripting Help TechVandal Programming 5 03-01-2009 04:22 PM
Reading a bash variable in bash scripting problem freeindy Programming 3 11-27-2008 03:29 AM
Help with bash scripting amishtechie Programming 5 09-28-2008 05:59 AM
new to bash scripting peok Programming 2 07-15-2006 03:46 AM
Bash scripting kbeaver Programming 5 07-18-2003 09:35 PM


All times are GMT -5. The time now is 01:42 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration