10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello everyone,
I need help in understanding the default value for getopts option's argument in ksh. I've written a short test script:
#!/bin/ksh
usage(){
printf "Usage: -v and -m are mandatory\n\n"
}
while getopts ":v#m:" opt; do
case $opt in
v) version="$OPTARG";;
... (1 Reply)
Discussion started by: da1
1 Replies
2. UNIX for Advanced & Expert Users
Hello Gurus :)
I'm "currently" (for the last ~2weeks) writing a script to build ffmpeg with some features from scratch.
This said, there are quite a few features, libs, to be downloaded, compiled and installed, so figured, writing functions for some default tasks might help.
Specialy since... (3 Replies)
Discussion started by: sea
3 Replies
3. Shell Programming and Scripting
I want to use getopts in ksh scripting to obtain multiple values
currently im using
while getopts vt: opt
do
case "$opt" in
-v) vn=$OPTARG;;
-t) tn="$OPTARG";;
;; # terminate while loop
esac
done
however variables vn tn dont store any... (3 Replies)
Discussion started by: E.sh
3 Replies
4. Shell Programming and Scripting
Hi,
the getopts doesnt seem to be working in the subshell of the ksh. when I echo $@ and $* from the subshell it shows nothing. even when I am capturing the parameters from the outer shell and passing while invoking the file then I am still not getting it properly.
the below code is in the... (9 Replies)
Discussion started by: hitmansilentass
9 Replies
5. Shell Programming and Scripting
I use the "getopts" ksh built-in to handle command-line options, and I'm looking for a clean/standard way to "unset" an option on the command line. I don't know if this is a technical question about getopts or more of a style/standards question. Anyway, I understand that getopts processes its... (4 Replies)
Discussion started by: Matt Miller
4 Replies
6. Shell Programming and Scripting
Hi All,
I am using geopts inside a function in shell script.
But it is doesnt seem to read the input args and I always gt empty value in o/p.
my code is
http://sparshmail.ad.infosys.com/owa/14.2.318.4/themes/base/pgrs-sm.gif
This message has not been sent.
#!/bin/ksh IFS=' '... (1 Reply)
Discussion started by: prasperl
1 Replies
7. Shell Programming and Scripting
I am trying to make a Shell Script in KSH on Linux box and Solaris box which takes few arguments... with long options using getopts (not getopt).
I have my sample code... at the end I will say my requirement... Please help me folks...
$ cat dummy
#!/bin/bash
# Argument = -t test -r server... (6 Replies)
Discussion started by: explorer007
6 Replies
8. Shell Programming and Scripting
Hi All
I have searches getopts function in Perl a lot, but yet i didn't cleared with it.
First I want to know what is the meaning of
getopts('t:c:', \%options);
and please explain getopts function in an easy way.. (4 Replies)
Discussion started by: parthmittal2007
4 Replies
9. Shell Programming and Scripting
If I call my function with grouped options: "logm -TDIWEFO 'message' ", then only the "T" gets parsed correctly. The subsequent values returned have underscores prefixed to the value: "_D", "_I", etc. If I "logm -T -DIWEFO 'message' ", the "T" and the "D" are OK, but "I" through "O" get the... (2 Replies)
Discussion started by: kchriste
2 Replies
10. Shell Programming and Scripting
Hello,
I'm writing a script that uses command line options and arguments. To handle these, I'm using getopts. Is there a way to set up an option where an argument is optional?
What I'm trying to do is offer -v for verbose output, -vv for increased output -vvv etc.
Any suggestions?
... (1 Reply)
Discussion started by: garskoci
1 Replies