LINUX programming

Moderators: ITA
Number of threads: 1339
Number of posts: 2924

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
BASH: Script Input Flags Posted by Grizzly521 on 12 Oct 2009 at 9:11 PM
Hi. Im wondering if there is a way to use flags when starting a script.
Something like this.

Script -a -b 10


Right now Ive got something like this.

while getopts ab AA
   do case $AA in
       a) var="value"
       ;;
   esac
done          


So with that code I can only use flags ( -a -b ). Can I do the -b 10 so it will store say varB=10?





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.