LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 12-03-2013, 07:52 PM   #1
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Rep: Reputation: 52
Bash script question


Sorry for the basic question , but how do I execute two different commands one after the other by manually entering it? Do I have to skip a line or how is that done?

Thanks in advance!
 
Old 12-03-2013, 08:17 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

I'm not sure what you are asking. Perhaps you mean something like
Code:
command1 ; command2
Alternatively, if you only want command2 to run if command1 exited without an error:
Code:
command1 && command2
If this is not what you are looking for, please restate the question.

Evo2.
 
1 members found this post helpful.
Old 12-03-2013, 09:31 PM   #3
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 81
i do understand only that evo2 does. so the answer would be the same :

Code:
command1; command2
 
1 members found this post helpful.
Old 12-04-2013, 03:37 PM   #4
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Original Poster
Rep: Reputation: 52
I think it has to do with bash putting the fist command in the background automatically. If I do ApplicationName ; Killall ApplicationName , bash opens the application but hangs until I close the application with the GUI and then reads the message (ApplicationName: no process found).
 
Old 12-04-2013, 06:42 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

ok it sounds like you want the following:
Code:
command1 &
command2
This will run command1 and (almost) immediately put it in the background and then launch command2.

Evo2.
 
1 members found this post helpful.
Old 12-05-2013, 04:34 PM   #6
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Original Poster
Rep: Reputation: 52
Thanks for the help! I seem to have problems with bash not doing what is should from time to time. Now it works!
 
  


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-script] A question about using grep in the script thomas2004ch Linux - Software 2 03-05-2012 03:27 AM
Bash Script Question Jack128 Programming 7 04-05-2009 04:29 AM
bash script question soybean pete Linux - General 5 05-23-2007 11:33 AM
bash script question armandino101 Linux - Newbie 5 10-18-2006 05:32 PM
Bash script question deiussum Programming 6 08-14-2004 11:43 AM


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

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