The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fork multiple shells amit4g High Level Programming 3 05-01-2008 12:05 PM
running multiple scripts nvuradi Shell Programming and Scripting 3 08-13-2007 06:53 AM
scripts running under different users csnewbie UNIX for Dummies Questions & Answers 1 02-14-2007 12:52 PM
Running three scripts parallelly anwarsait Shell Programming and Scripting 1 07-17-2006 10:20 PM
Switching shells in UNIX Scripts Scoobiez Shell Programming and Scripting 2 11-10-2005 08:35 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-20-2005
Registered User
 

Join Date: Dec 2005
Posts: 2
How to open multiple shells while the scripts keeps running.

Hello, I've tried for a while now to run a bash script that continues to the end, while opening new shells as needed.

I've tried
Code:
 xterm -e "somecommand"; &
 xterm -e " somecommand";
I've also tried
Code:
screen -S "somecommand"; &
screen -S "somecommand";
All without any luck, they both work but only open a new shell once the command has finished or I kill the process.
I really need the script to open multiple shells at the same time and continue till the end.

Any help or direction will be much appreciated.

Regards

Last edited by Ygor; 12-20-2005 at 09:32 PM.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-21-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
You might want to post your script. I tried the following:
Code:
#!/bin/bash
echo "starting"
xterm -e "sleep 5"; &
echo "see the xterm"
ls
sleep 1
exit
And got a syntax error near unexpected token "&" - when I removed the ; and moved the & over one, then it ran with no issue (with the xterm popping up running the command and the original script continuing on and exiting before the xterm went away which I believe is what you are looking for)
Reply With Quote
  #3 (permalink)  
Old 12-21-2005
Registered User
 

Join Date: Dec 2005
Posts: 2
Thanks RTM, after removing the ";" and moveing the "&" over it ran like a charm, all I have to do now is play around with "sleep" so the shell opens at the correct time.
Thanks again.
Regards
Reply With Quote
  #4 (permalink)  
Old 10-06-2006
Registered User
 

Join Date: Oct 2006
Posts: 3
Hi there,

I've been trying to do something simular as discriber here with csh scripting with AIX.

When I excecute: xterm -e "sleep 5" with or without ; or & the xterm window opens but no command is being excecuted.

Any more suggestions?

Thanks for any help!
Robbert
Reply With Quote
  #5 (permalink)  
Old 10-06-2006
Registered User
 

Join Date: Jan 2006
Posts: 43
I getting the error as

xterm: Can't execvp ls -ltr

any one has ideas abt this??
Reply With Quote
  #6 (permalink)  
Old 10-08-2006
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
For Nilesrex: The error you received is should show more information.

Quote:
(Example from this message )

xterm -e some_program

if some_program doesn't exist in $PATH, what ends up happening is that a
new xterm opens with the error message "xterm: Can't execvp some_program: No such file or directory", and gives a command prompt.
In your example, is there anything more to the error message?

(Also, please start a new thread next time you have a question instead of hijacking someone else's thread - it makes it harder to answer everyone involved. Thanks.)
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0