thanks for the suggestion @ctac_
i tried that but it was not giving me desired result as if i give 4 parameters the last parameter i.e. "-f" was taking first parameter's argument so i made some changes and now its working for both cases: here is my final code
so thanks for you reply i got the idea how OPTIND works..let me know if we can tweak it more?
Here is my post with a question about getopts. I am running korn shell on Solaris 5.8. I am trying to ensure that certain options require a parameter, which is easy enough. I have found that if multiple options are entered on the command line together, but the parameter for one of the options is... (1 Reply)
Hi,
I am trying to call a function inside a shell script. Is there a way in which I can make the parameters options in the call?
Please help me with this.
Thanks!!! (2 Replies)
Hello,
On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command.
tunrestore -R is present in inittab
in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log
... (0 Replies)
Hi, this is my problem
I have script with two parameters -n name and -s surname. Both have arguments and I want to know how parse these parameters with getopts. When you write
./names -n John -s White
it find you all persons, which name is John White, but when you write
./names -n John ... (1 Reply)
Hello,
I have a shell script "Test.ksh" and I need to pass 8 parameters/arguments while executing the script
./Test.ksh 1 2 3 4 5 6 7 8
Out of these I want first 3 to be compulsory and rest 5 to be optional. Can you suggest the way to do this like and also how to pass these optional... (3 Replies)
In the below code
while getopts :rfw:d:s:a: options
do
case "$options" in
r) echo reverse;;
f) echo forward;;
w) window=$OPTARG;;
d) duration=$OPTARG;;
s) search=$OPTARG;;
a) value=$OPTARG;;
*) help; exit;;
esac
done
... (2 Replies)
How to declare the two argument for optional switch ?
I have a script that search for a string in current or old zipped log file.
Im using a option something like this
${basename}
Since $1 can have only one argument should be passed when user select swicth -c and -o need to... (3 Replies)
Hi,
Does the order of argument and non-argument command line parameters matter to getopts?
with a getopts line in my script of
getopts p:cs opt
a command line of <script> -p 5 -s
only picks up the -p option, while <script> -s -p 5 picks up both.
Removing the space between the p and the... (3 Replies)
Please forgive but I am new to Linux and still learning. When installing Linux (any flavor) over PXE, it asks if you want to customize which packages to install. Most engineers ask us to install all packages but this entails A LOT of clicking. Is there a way to "select all" packages by using a... (3 Replies)
There are many places where I can see the syntax description for optargs, which, usually boils down to this:
getopts OPTSTRING VARNAME
where:
OPTSTRING tells getopts which options to expect and where to expect arguments
VARNAME tells getopts which shell-variable to use for option reporting... (2 Replies)
Discussion started by: sharkura
2 Replies
LEARN ABOUT DEBIAN
latexml::parameters
LaTeXML::Parameters(3pm) User Contributed Perl Documentation LaTeXML::Parameters(3pm)NAME
"LaTeXML::Parameters" - formal parameters, including "LaTeXML::Parameter".
DESCRIPTION
Provides a representation for the formal parameters of LaTeXML::Definitions:
"LaTeXML::Parameter"
represents an individual parameter.
Parameters Methods
"$parameters = parseParameters($prototype,$for);"
Parses a string for a sequence of parameter specifications. Each specification should be of the form
{} reads a regular TeX argument, a sequence of
tokens delimited by braces, or a single token.
{spec} reads a regular TeX argument, then reparses it
to match the given spec. The spec is parsed
recursively, but usually should correspond to
a single argument.
[spec] reads an LaTeX-style optional argument. If the
spec is of the form Default:stuff, then stuff
would be the default value.
Type Reads an argument of the given type, where either
Type has been declared, or there exists a ReadType
function accessible from LaTeXML::Package::Pool.
Type:value, or Type:value1:value2... These forms
pass additional Tokens to the reader function.
OptionalType Similar to Type, but it is not considered
an error if the reader returns undef.
SkipType Similar to OptionalType, but the value returned
from the reader is ignored, and does not occupy a
position in the arguments list.
"@parameters = $parameters->getParameters;"
Return the list of "LaTeXML::Parameter" contained in $parameters.
"@tokens = $parameters->revertArguments(@args);"
Return a list of LaTeXML::Token that would represent the arguments such that they can be parsed by the Gullet.
"@args = $parameters->readArguments($gullet,$fordefn);"
Read the arguments according to this $parameters from the $gullet. This takes into account any special forms of arguments, such as
optional, delimited, etc.
"@args = $parameters->readArgumentsAndDigest($stomach,$fordefn);"
Reads and digests the arguments according to this $parameters, in sequence. this method is used by Constructors.
AUTHOR
Bruce Miller <bruce.miller@nist.gov>
COPYRIGHT
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
perl v5.10.1 2009-06-11 LaTeXML::Parameters(3pm)