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
passing variable from bash to perl from bash script arsidh Shell Programming and Scripting 10 06-04-2008 01:25 PM
Why generate "ash and bash" different output for same bash script? s. murat Shell Programming and Scripting 0 05-26-2008 08:19 AM
[BASH - KSH] Passing array to a function ripat Shell Programming and Scripting 3 04-17-2008 09:17 AM
find options don't work in script mattd Shell Programming and Scripting 3 04-30-2007 11:31 AM
Handeling multiple options in script virus_stinger Shell Programming and Scripting 2 05-23-2006 02:31 PM

 
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 05-21-2008
DeCoTwc DeCoTwc is offline
Registered User
  
 

Join Date: Mar 2008
Location: NYC
Posts: 77
Passing options to a bash script

I'm just not sure where to start looking into this. I want to be able to create switches for my script. Back in the day I'd make my scripts interactive...you know:


Code:
echo "what report do you want"
echo "A)boxes with errors"
echo "B)boxes with more than 5 errors"
echo "C)Service groups that have thrown errors"
read $1
if ...

but now that seems kind of amateurish. I'd rather have a script where errorreport.sh -c made a list of boxes, errorreport.sh -m listed boxes with multiple errors and so on.

I'm not asking anyone to give me a step by step on how to do this, I'd rather learn by doing, but I don't even know where to start. I've tried googling "adding switches to bash scripts" and the like, and I've been scanning my o'reiley books, but at quick glance I don't see what I'm looking for.

If anyone could tell me where I might at least start reading up on this I'd appreciate it.
 

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 06:54 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