Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 13th, 2005, 8:57 AM   #1
pico
Newbie
 
Join Date: Nov 2004
Posts: 6
Rep Power: 0 pico is on a distinguished road
using getopt in a shell script

Hi all.

I'm pretty new to shell scripting and would like to know if it is possible to use getopt in my shell script so that the parsing of parameters is done for me.
For example I want to make a shell script that creates a javac compile command for you. Lets call my script makecompile.
makecompile -l /libraryLocation myprog.jar

or
makecompile myprog.jar -l /libraryLocation

should both have the same effect and would add all the files in the /libLocation to the classpath.

I've read most of the getopt manual, but I'm just not sure how to use getopt in a script. A small example of doing this would be appreciated.

BTW I'm not even sure that getopt is the right thing to use, I just came across it and thought it would be a good idea.

Thanks in advance.
Pico
pico is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:12 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC