10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm using getopts to process command line args in a Bash script. The code looks like this:
while getopts ":cfmvhs:t:" option; do
case $option in
c) operationMode="CHECK"
;;
f) operationMode="FAST"
;;
m) ... (6 Replies)
Discussion started by: gencon
6 Replies
2. Shell Programming and Scripting
i have the following scenario want to run the following script with manadory and optional argumnets
Manadory options are :
filename=""
port=""
optional arguments
type -t
balances -b bal
prices -p
./test filename port -t A -b bal
my code i have that won't parse the options is... (1 Reply)
Discussion started by: nano2
1 Replies
3. Shell Programming and Scripting
hi,,,,
I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for... (2 Replies)
Discussion started by: vins_89
2 Replies
4. Shell Programming and Scripting
Is it possible to get a script that uses getopts to accept options and arguments in any order?
eg. -g -h 2 4 works like -g 2 -h 4. (1 Reply)
Discussion started by: lee.n.doan
1 Replies
5. UNIX for Dummies Questions & Answers
hi, can someone how to accept command line arguments as a variable using in script?
like: ./scriptname arguments
by accept arguments, I can use it in my script?
thx! (1 Reply)
Discussion started by: ikeQ
1 Replies
6. Shell Programming and Scripting
Hi all,
I am trying to use long arguments for my existing script. right now my script would work if given <script_name> -t <arg1> -b <arg2> -v <arg3>. The script code is shown below.
while getopts t:v:b: OPT;do
case "$OPT" in
t) Todo=$OPTARG;;
b) Batch=$OPTARG;;
... (3 Replies)
Discussion started by: SSSB
3 Replies
7. UNIX for Dummies Questions & Answers
I am working on a script wherein i need the user to enter the Build ID
for eg:the command line will show
enter the build ID
Now on entering the build ID it should be assigned to @ARGV.
How can this be done.? (1 Reply)
Discussion started by: Varghese
1 Replies
8. Shell Programming and Scripting
Hello everyone,
Is it possible to use getopts and also receive arguments without option flags?
e.g. myscript arg1 arg2 -a arg3 -b arg4
If so, how do you stop getopts from exiting as soon as it detects the non-option arguments? (2 Replies)
Discussion started by: kdelok
2 Replies
9. Shell Programming and Scripting
--------------------------------------------------------------------------------
I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence... (1 Reply)
Discussion started by: skooly5
1 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
How many arguments can we pass while testing a prgm at command line..
I encountered an issue while passing 10 arguments.
For $10 its taking argument passed for $1 followed by 'zero'.
can we pass more than 9 arguments /Is there any other way.
Thanks,
rrs (6 Replies)
Discussion started by: rrs
6 Replies