10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi. I have a piece of code that reads and parses command line options. I'd like to alter it slightly to read from a string (that's set elsewhere in the script) rather than directly from the command line (arg). Can somebody show me how to do this? Many thanks.
My code is as follows:
typeset... (6 Replies)
Discussion started by: user052009
6 Replies
2. Shell Programming and Scripting
I have a shell script, which has a function, which call a perl script. Also it has a shell function call parse_ars as fogllow:
#!/bin/ksh
load_ici_dat() {
cd ${OUTPUT_DIR}
typeset batch_file=XRED${MM}${DD}
typeset SCRIPT="${PROG}.pl"
echo "time ${PERLEXE5X} ${PERL_HOME}/${SCRIPT}... (1 Reply)
Discussion started by: digioleg54
1 Replies
3. Shell Programming and Scripting
]I have a string like "/abc/cmind/def/pq/IC.2.4.6_main.64b/lnx86" and this string is given by user. But in this string instead of 64b user may passed 32 b an i need to parse this string and check wether its is 32b or 64 b and according to it i want to set appropriate flags.
How will i do this... (11 Replies)
Discussion started by: codecatcher
11 Replies
4. Programming
Hi,
I've a python script called aaa.py and passing an command line option " -a" to the script like, ./aaa.py -a
& Inside the script if the -a option is given I do some operation if not something else.
code looks like
./aaa.py -a
.
.
if options.a
---some operation---
if not options.a... (1 Reply)
Discussion started by: testin
1 Replies
5. 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
6. Shell Programming and Scripting
Hi unix guru's
I want to execute a shell script like ksh printdetails.ksh Andy,Bob,Daisy,Johnson
like passing all the four names in the as the arguments and these arguments are varies between 1 to 10.
How to pass these names to the shell script variable.
and also i want to know the count... (4 Replies)
Discussion started by: Reddy482
4 Replies
7. UNIX for Dummies Questions & Answers
Hi, I'm having problems with a script where I wanted every single option specified in the command line to have an argument taken with it, but for some reason only d works in the code I will be showing below.
For example if I did ./thisfile -a something
it would come up with "a chosen with " as... (2 Replies)
Discussion started by: IceX
2 Replies
8. Shell Programming and Scripting
Looking for a little help parsing some command line arguments in a bash script I am working on, this is probably fairly basic to most, but I do not have much experience with it.
At the command line, when the script is run, I need to make sure the argument passed is a file, it exists in the... (3 Replies)
Discussion started by: Breakology
3 Replies
9. 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
10. UNIX for Advanced & Expert Users
Is there a way to get the command line arguments.
I am using getopt(3) but if the arguments are more than one for a particular option than it just ignores the second argument. For eg
./a.out -x abc def
now abd will be got with -x using getopt "( x : )" and string abc\0def will get stored... (7 Replies)
Discussion started by: jayakhanna
7 Replies