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
facing problem in starting a process in background using shell script. dtomar Shell Programming and Scripting 8 04-17-2008 09:11 AM
shell script for extracting out the shortest substring from the given starting and en pankajd Shell Programming and Scripting 18 03-10-2008 06:20 AM
Trying to manage an inherited Ksh script ajcannon Shell Programming and Scripting 1 08-15-2007 07:54 AM
Help starting a simple shell script. dickmartin Shell Programming and Scripting 2 07-29-2004 10:02 AM
How to manage multiple versions of a set of shell and SQL script utilities DennisB Shell Programming and Scripting 2 06-23-2004 09:13 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-28-2007
ai_dba ai_dba is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 3
Unhappy Manage starting point in shell script.

Hi,
I'd like to run a script with an optional starting point.
Meaning that if no parameter for the script => Do everything, otherwise start from the point specified in the parameter and continue till the end.

I thought of using the "case ..." but I have no result.
Script:
# ---------------
START_POINT=$1
if [ "$START_POINT" = "" ]
then
START_POINT="a"
fi
echo ">$START_POINT<"
case $START_POINT in
"a") echo "Running >a<!";;
"b") echo "Running >b<!";;
"c") echo "Running >c<!";;
"d") echo "Running >d<!";;
default) echo "Wrong value for starting point";;
esac
return
# ---------------
result expected:
> script [nothing]
Running >a<!
Running >b<!
Running >c<!
Running >d<!

> script c
Running >c<!
Running >d<!

> script k
Wrong value for starting point

Please provide some help.
Thanks in advance.
Regards!
 

Bookmarks

Tags
shell script

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 09:04 AM.


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