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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
linux reverse page order+duplex is not working uttamhoode UNIX for Advanced & Expert Users 0 06-02-2008 07:06 AM
Start and stop of an application thru shell scripts. sadha Shell Programming and Scripting 1 05-08-2006 10:36 AM
Start Stop Apache MILLERJ62 AIX 2 12-27-2005 05:40 PM
sort a file in reverse order frustrated1 Shell Programming and Scripting 11 09-21-2005 04:41 PM
using sed and regex to reverse order??? urtherhoda UNIX for Dummies Questions & Answers 2 10-13-2004 11:57 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-05-2006
madasafish madasafish is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 1
Stopping Start/Stop scripts in reverse order

#Define the Start/Stop/Status Scripts to include
SSS_SCRIPTS=( prog1 prog2 prog3 etc...... )

#Start the scripts
StartScripts()
{
for SSS in ${SSS_SCRIPTS[*]}
do
./$SSS start
done
}

#Stop the Scripts
StopScripts()
{
for SSS in ${SSS_SCRIPTS[*]}
do
./$SSS stop #<---I want it to stop in reverse order eg: Prog3 Prog2 Prog1....
done

Any help appreciated

madasafish
  #2 (permalink)  
Old 08-05-2006
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
One way of doing it....

Code:
COUNT=2
set -A PROG prog1 prog2 prog3
until (( ${COUNT} < 0 )); do
echo "killing ${PROG[${COUNT}]}"
let COUNT=${COUNT}-1
done

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0