![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| URL call from SHELL script | chengwei | Shell Programming and Scripting | 33 | 08-26-2008 06:21 AM |
| Call shell script from php not run ? | raccsdl | Shell Programming and Scripting | 2 | 11-19-2007 04:21 AM |
| To call/execute a shell script from a shell script | konark | UNIX for Dummies Questions & Answers | 1 | 10-26-2007 02:16 PM |
| How to call a perl script from a shell script | anumkoshy | Shell Programming and Scripting | 2 | 08-30-2007 01:23 AM |
| exit a shell script!! | sami98 | Shell Programming and Scripting | 4 | 03-27-2007 01:55 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a shell script that calls another shell script "str_process_main" that runs in a loop until a given time. I want the first script to just call the second one and then exit. The first script is:
Code:
#!/bin/ksh
DATE=$(date +%m%d%y)
DPID=$(ps -ef|grep str_process_main|grep -v grep)
if [ "${DPID}" = "" ]; then
cd /usr/local/wss_polling
str_process_main
echo "The process was not running."
else
echo "The process is already running: $DPID."
fi
exit
|
| Forum Sponsor | ||
|
|
|
|||
|
check it
just call the second script as
#!/bin/ksh DATE=$(date +%m%d%y) DPID=$(ps -ef|grep str_process_main|grep -v grep) if [ "${DPID}" = "" ]; then cd /usr/local/wss_polling . str_process_main echo "The process was not running." else echo "The process is already running: $DPID." fi exit note that the 2nd script is called using a dot (.) this dot notation runs the second script in the same shell ..i.e calling shell .. if u call it without using a dot ...then also the script will run ... but in a new shell ..( sub-shell) |
|
|||
|
run the script with nohup in background
#!/bin/ksh DATE=$(date +%m%d%y) DPID=$(ps -ef|grep str_process_main|grep -v grep) if [ "${DPID}" = "" ]; then cd /usr/local/wss_polling nohup str_process_main & echo "The process was not running." else echo "The process is already running: $DPID." fi exit |
|||
| Google The UNIX and Linux Forums |