The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 11-20-2006
dhananjayk dhananjayk is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 12
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)