The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing a list of dynamic names to a "PS" command in shell script? sachin.tendulka Shell Programming and Scripting 3 11-21-2007 12:18 AM
Q: Recording shell script screen output using "script" command ? lalfonso.gomez Shell Programming and Scripting 4 01-18-2007 05:31 PM
how to include slashes "/" in @ARGV (Perl) umen Shell Programming and Scripting 3 01-30-2006 07:21 PM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 12:15 AM
My "Bread and Butter" Process Keep Alive Perl Script.... Neo Tips and Tutorials 0 01-08-2005 01:17 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-11-2008
Registered User
 

Join Date: Dec 2007
Posts: 21
How to include RETURN KEY with Background process "&" in Shell Script

Hello All,

I am a newbie in Shell script programming, and maybe you can help me with my query.

I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script.

The mntServer.ksh script contains:

#!/bin/ksh
/home/test/bin/squishserver &
/home/test/bin/inst_feature_test.ksh

However, when I run the mntServer.ksh script, it seems to just hang when the squishserver & process is being started and it doesnt continue to execute the next command on the script which is inst_feature_test.ksh.

# ./mntServer.ksh
Port: 4322


If I execute the squishserver & in command prompt, I need to press enter to go back to command prompt.

Is there a way I can incorporate a Return key in the shell script so that I can successfully start the squishserver & command and all the succeeding commands after it?


Thanks a lot in advance.


racbern
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-11-2008
Registered User
 

Join Date: Mar 2008
Posts: 7
You can do like this

#!/bin/ksh
/home/test/bin/squishserver > /dev/null 2>&1 &
/home/test/bin/inst_feature_test.ksh


Redirecting the output of squishserver to the desired output files. Can be /dev/null or any other output file you can give.

I hope that will help.

Sanjay
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:29 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