Run commands in a script in different shells


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run commands in a script in different shells
# 1  
Old 03-30-2013
Run commands in a script in different shells

Hi to all,

i have the following problem...
i want to run three commands in a script in different shells... the first command is running always and is needed for the second on to run properly... example
Code:
# Procedure 1
xterm -e exec1 arg1 arg2 
# Procedure 2
xterm -e exec2 arg1 arg2
# Procedure 3
xterm -e exec3 arg1 arg2

Procedure 1 is still running while Procedure 2 must start!!!!

Thanks in advance
P.

Last edited by paladinaeon; 04-01-2013 at 05:12 AM..
# 2  
Old 03-30-2013
If you want a command to run in the background, put an & after it.
# 3  
Old 03-31-2013
Thanks for the reply but that will not work since command 1 occupies the terminal by sending messages... It can't go to background
# 4  
Old 03-31-2013
and that sounds nonsense because xterm creates an own independent terminal.
# 5  
Old 03-31-2013
What is the nonsense? Command 1 prints messages to the terminal... And it occupies it. Adding & does not solve the problem!

Last edited by paladinaeon; 03-31-2013 at 08:31 PM..
# 6  
Old 03-31-2013
There is some serious confusion going on here. Try to work it out politely. Or I'm closing the thread.

Do you think it is possible to have multiple terminals running concurrently? If you did not then why would you have asked your question?
# 7  
Old 04-01-2013
Hi to all,

i found a solution to my problem! I directed the text that is printed to screen by the first executable to a textfile and used the &.

Thanks
P.

PS
Maybe i was not clear enough in my question!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

How to run an script and its commands via proxy?

Hi, i used this tutorial which tells me to use following example command to proxify traffic from my linux export {http,https,ftp}_proxy=122.228.156.126:80 when i do this command from command line it works and then i curl http://site/ipcheck.php i see its proxified, which is what i want to... (5 Replies)
Discussion started by: postcd
5 Replies

2. UNIX for Dummies Questions & Answers

Commands to run from shell script

Hi script> isumid 98765432 if i give above command in cmd prompt it is running the same thing if i give inside the shell script it is not working below is the code #!/bin/bash isumid 98765432 please give me a solution (16 Replies)
Discussion started by: Ramrangasamy
16 Replies

3. Shell Programming and Scripting

How to run sudo commands under a script?

Hi, I am new to scripting. I am trying to write a script to ssh one remote machine and run a sudo command. ssh <hostname> sudo -S <command> < ~/pass.txt I am stored my password in pass.txt. I am getting error sudo: no tty present and no askpass program specified Please suggest me how can... (1 Reply)
Discussion started by: venkia9
1 Replies

4. UNIX for Dummies Questions & Answers

How to run additional shells

Hi, unix newbi here. Im currently on the bash shell, what are the commands to run additional shells? for example i want to run csh and then ksh? Thanks. BT. (2 Replies)
Discussion started by: BillThompson
2 Replies

5. Shell Programming and Scripting

Question regarding shells and subshells when a script is run

I have the following script running with nohup on one of my servers: #!/bin/bash #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ #set log number #i=1 #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ #Check if log exits, if so incrememnt log number up so we don't clobber #while... (8 Replies)
Discussion started by: DeCoTwc
8 Replies

6. Shell Programming and Scripting

[Help] script how to run 2 commands simultaneously

#!/bin/sh firefox index.html firefox secondpage.html hey guys, im not able to open up two pages at the same time... it always open up index.html first, and only after i close it, then the 2nd page pops up... is there any way i can run both commands at the same time? i appreciate any... (2 Replies)
Discussion started by: funnyguy123
2 Replies

7. Shell Programming and Scripting

run commands within a script on certain days

Hi, please advise a script, something like this: If ; then do something else ( or for any other day of the week ) do otherthing fi Thanks (5 Replies)
Discussion started by: fed.linuxgossip
5 Replies

8. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

9. Shell Programming and Scripting

shell script to run a few commands help!

Hi friends this is first post i am very new to shell scripting so i require your expertise to do the following thank u I need to write a shell script which will run the following commands pg_dump bank > backup(Enter) Wait for bash prompt to appear coz it indicates that the command is... (23 Replies)
Discussion started by: perk_bud
23 Replies

10. UNIX for Advanced & Expert Users

script to run different shells which run different processes

Hi, Would like to ask the experts if anyone knows how to run a script like this: dtterm -title shell1 run process1 on shell1 dtterm -title shell2 run process2 on shell2 cheers! p/s: sorry if i used the wrong forum, quite concussed after watching world cup for several nights; but I... (2 Replies)
Discussion started by: mochi
2 Replies
Login or Register to Ask a Question