I guess I didn't explain things well. I assumed using a variadic function would be the only way to get optional and required parameters. I tried to implement the code from Corona688 in my own, but could not get it to work. I did more searching and came back to example 2 on this page I had been to before:
I'm using getopt() to get command line options.One the optons accepts and argument.The argument is and offset.I was wondering how can I scecify that it's argument is of the type off_t.I've something like this "offset=(off_t)optarg" and it don't work. (1 Reply)
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)
#!/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)
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)
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)
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 DEBIAN
yaz-url
YAZ-URL(1) Commands YAZ-URL(1)NAME
yaz-url - YAZ URL fetch utility
SYNOPSIS
yaz-url [-H name:value] [-m method] [-O fname] [-p fname] [-u user/password] [-x proxy] [url...]
DESCRIPTION
yaz-url is utility to get web content. It is very limited in functionality compared to programs such as curl, wget.
The options must be precede the URL given on the command line to take effect.
Fetched HTTP content is written to stdout, unless option -O is given.
OPTIONS -H name:value
Specifies HTTP header content with name and value. This option can be given multiple times (for different names, of course).
-m method
Specifies the HTTP method to be used for the next URL. Default is method "GET". However, option -p sets it to "POST".
-O fname
Sets output filename for HTTP content.
-p fname
Sets a file to be POSTed in the folloing URL.
-u user/password
Specifies a user and a password to be uesd in HTTP basic authentication in the following URL fetch. The user and password must be
separated by a slash (this it is not possible to specify a user with a slash in it).
-x proxy
Specifies a proxy to be used for URL fetch.
SEE ALSO yaz(7)YAZ 4.2.30 04/16/2012 YAZ-URL(1)