03-02-2009
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
scriptname
i have made a script to perform so tasks and i managed to complete the tasks for all the options
the problem i am facing is that i can run the scripts individually but i would like to make it such that it can accept multiple options and give me the appropriate output
e.g.... (1 Reply)
Discussion started by: problems
1 Replies
2. Shell Programming and Scripting
#!/bin/sh
set -- `getopt "abco:" "$@"`
a= b= c= o=
while :
do
case "$1" in
-a) a=1;;
-b) b=1;;
-c) c=1;;
-o) shift; o="$1";;
--) break;;
esac
shift
done
shift # get rid of --
# rest of script...
# e.g.
ls -l $@ (6 Replies)
Discussion started by: Hitori
6 Replies
3. Shell Programming and Scripting
I m trying to use getopt
This is my script, but it doesn't take argument in variable,
Please help.
set - - `getopt mscl: $*`
if
then
echo "Exiting...."
exit 2
fi
for i in $*
do
case $i in
-m) MAIL="$i"; shift;;
-s) SCRIPT=$OPTARG; shift;;
-c) COB=$OPTARG; shift;;... (2 Replies)
Discussion started by: darshakraut
2 Replies
4. Shell Programming and Scripting
:)
Can anybody help me about how to use getopt in shell scripting. (3 Replies)
Discussion started by: darshakraut
3 Replies
5. Solaris
Hi All,
Could anyone tell me how to use getopt command.....?
Thanks,
Pintu (2 Replies)
Discussion started by: pintupatro
2 Replies
6. Shell Programming and Scripting
Hi,
I want to use the getopt function to parse some arguments for a script.
while getopts "i:f:r:" OPTION
do
case $OPTION in
i) iter=$OPTARG;;
f) frame=$OPTARG;;
r) roi=$OPTARG;;
?) echo Usage: ......
exit 2;;
esac
done
However, I... (5 Replies)
Discussion started by: giorgos193
5 Replies
7. Shell Programming and Scripting
Hi there, I have an example basic script (below) and ive been trying to figure out how to stop multiple arguments to my options occuring. for example using the example script below I can issue two arguments for, say the --surname option and it will not barf at me (although thats what i want it to... (11 Replies)
Discussion started by: rethink
11 Replies
8. Programming
Hi All
I am using Getopt::Long in perl and i am trying to have it so if i dont supply a switch after the progname is will do a defult option
i have the following
GetOptions($OPT,
'debug|d',
'mail|m',
) or info();
i want it run the debug if it is not given a switch
... (1 Reply)
Discussion started by: ab52
1 Replies
9. Shell Programming and Scripting
While going through some of the perl script...
I had found the below line..
use Getopt::Long;
my $GetOptionsReturnCode = GetOptions ( '<>' => sub { push(@unknownArg, @_); }, 'h|help' => sub { &helpMessage(); exit 0; }, );
Could anyone please explain the above one ... (1 Reply)
Discussion started by: scriptscript
1 Replies
10. Shell Programming and Scripting
Hi All,
An old work friend wrote a script which I've been trying to understand how a section of it currently works and work out how i can add some command line switches which i can use later in the script to append the output depending on the command line arguements.
Currently it works by... (1 Reply)
Discussion started by: mutley2202
1 Replies
LEARN ABOUT MOJAVE
moosex::getopt::processedargv5.18
MooseX::Getopt::ProcessedArgv(3pm) User Contributed Perl Documentation MooseX::Getopt::ProcessedArgv(3pm)
NAME
MooseX::Getopt::ProcessedArgv - MooseX::Getopt::ProcessedArgv - Class containing the results of process_argv
VERSION
version 0.59
SYNOPSIS
use My::App;
my $pa = My::App->process_argv(@params);
my $argv_copy = $pa->argv_copy();
my $extra_argv = $pa->extra_argv();
my $usage = $pa->usage();
my $constructor_params = $pa->constructor_params();
my $cli_params = $pa->cli_params();
DESCRIPTION
This object contains the result of a "process_argv" in MooseX::Getopt call. It contains all the information that "new_with_options" in
MooseX::Getopt uses when calling new.
METHODS
argv_copy
Reference to a copy of the original @ARGV array as it originally existed at the time of "new_with_options".
extra_arg
Arrayref of leftover @ARGV elements that Getopt::Long did not parse.
usage
Contains the Getopt::Long::Descriptive::Usage object (if Getopt::Long::Descriptive is used).
constructor_params
Parameters passed to process_argv.
cli_param
Command-line parameters parsed out of @ARGV.
AUTHOR
Stevan Little <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2007 by Infinity Interactive, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.18.2 2013-11-30 MooseX::Getopt::ProcessedArgv(3pm)