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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ls positional parameter vasuarjula AIX 1 02-13-2008 06:49 PM
Positional parameters shalu@ibm UNIX for Dummies Questions & Answers 2 11-22-2007 03:58 AM
positional grep Manish Jha Shell Programming and Scripting 1 05-16-2006 11:33 AM
Positional Parameters ericelysia UNIX for Dummies Questions & Answers 15 10-23-2005 12:11 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-26-2003
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Stumble this Post!
Positional Parameters

HPUX11.0/Korn Shell
I have an old script that takes in a series of arguments when its called. The script is really more of a common set of functions that gets called by other scripts as needed. I have been asked to make this into a menu driven script to rollout to app support for their use during support calls. The script currently uses getopts to evaluate and check the arguments passed to it. I want to add at most 2 menus but I dont want to have to rewrite the getopts and checksum. The script accepts arguments in the form: -s arg, -t arg -u arg etc. Is there a way to set the positional arguments $1, $2 , $3 from within the script (after the script has been executed) so that I can just plug in the menu without a lot of rework? Trying to save some time. Thanks for any and all responses and suggestions.

execute script (no args) --> display menu --> read choice --> display usage --> accept arguments from user --> pass to getopts function that is already written --> process request.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-26-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,444
Stumble this Post!
set - parm1 parm2 parm3 ...
Reply With Quote
  #3 (permalink)  
Old 09-26-2003
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Stumble this Post!
Thanks so much. Works just fine.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0