LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bash script question (https://www.linuxquestions.org/questions/linux-newbie-8/bash-script-question-4175486758/)

theKbStockpiler 12-03-2013 07:52 PM

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!

evo2 12-03-2013 08:17 PM

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.

SAbhi 12-03-2013 09:31 PM

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

Code:

command1; command2

theKbStockpiler 12-04-2013 03:37 PM

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).

evo2 12-04-2013 06:42 PM

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.

theKbStockpiler 12-05-2013 04:34 PM

Thanks for the help! I seem to have problems with bash not doing what is should from time to time. Now it works!


All times are GMT -5. The time now is 08:54 PM.