I need to put a command line parser together to parse numeric fields and ranges passed to a script. I'm looking for a bash function that is as elegant and simple as possible.
So the input would be of the following form -
This would return -
Input can contain multiple positive or negative ranges of the form -
in any order with comma delimited single integers interspersed anywhere on the line.
I've come up with some code but frankly its ugly and I suspect that this is a problem that's been solved before.
Hi Experts,
How do I parse a XML with below contents
<saw:user name="mbussey@xyz.com" />
<saw:user name="kimmy.chan@pqr.com" />
<saw:user name="chudgins@gmail.com" />
and retrieve below output ?
mbussey@xyz.com
kimmy.chan@pqr.com
chudgins@gmail.com
... (17 Replies)
I would like to take a fasta file formated like
>0001
agttcgaggtcagaatt
>0002
agttcgag
>0003
ggtaacctga
and use command line perl to move the all sample gt 8 in length to a new file. the result would be
>0001
agttcgaggtcagaatt
>0003
ggtaacctga
cat ${sample}.fasta | perl -lane... (2 Replies)
I've defined the order of elements which needs to be print in a order in a variable. please let me know how can I use it in awk command
... (2 Replies)
]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)
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)
I have a simple script that builds a complex program call which passes a number of parameters to the program. I'm trying to enhance the script to include the value of the command line parameter in the name of a file being created. The problem I'm having is that the parameter may include a forward... (11 Replies)
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)
Hi,
My perl script takes few switches which i'm parsing through GetOpt::Long module.
My script looks like something :
myscript.pl --file="foo" --or --file="bar"
The --file switch takes 2 arguments foo and bar.
The 2 values of file are separated by --or switch. I want to ensure that... (1 Reply)
how to parse the command line argument to look for '@' sign and the following with '.'.
In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format.
rmjoe123@hotmail.com has '@' sign and followed by a '.'
to be more... (1 Reply)
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)