![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use ftp command in shell script | infyanurag | Shell Programming and Scripting | 3 | 02-05-2008 08:06 AM |
| how to use cd command in shell script | LAKSHMI NARAYAN | Shell Programming and Scripting | 3 | 09-09-2007 07:04 AM |
| Using the Esc key to complete command line typing | jxh461 | UNIX for Dummies Questions & Answers | 1 | 06-05-2007 07:04 PM |
| vi command in shell script | bryan | UNIX for Dummies Questions & Answers | 2 | 05-23-2006 08:51 PM |
| Shell script command | dipanrc | Shell Programming and Scripting | 7 | 11-29-2005 11:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Wondering why belows code works fine if i type in the command prompt but it seems not executed when i code them in a file with additional if-then-else statement. Code:
#!/bin/sh
. $HOME/.profile
pid=`ps -ef | grep -w XELstnr | grep -v grep | awk {'print $2'}`
if [ $pid !='' ]
then
echo "Stopping XELstnr....."
kill -9 $pid
echo "XELstnr stopped."
else
echo "XELstnr is not running."
fi
exit
Please advise. Thanks. Last edited by vino; 07-28-2006 at 05:14 AM.. Reason: Introduced code tags. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|