10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
While going through some of the perl script...
I had found the below line..
use Getopt::Long;
my $GetOptionsReturnCode = GetOptions ( '<>' => sub { push(@unknownArg, @_); }, 'h|help' => sub { &helpMessage(); exit 0; }, );
Could anyone please explain the above one ... (1 Reply)
Discussion started by: scriptscript
1 Replies
2. Shell Programming and Scripting
grep " $1 " completelist
if
then
echo "$1 not found."
fi
Is there a Perl solution that just as short sweet and fast ? (1 Reply)
Discussion started by: popeye
1 Replies
3. Shell Programming and Scripting
Hi,
I have a very long pipe delimited string. The length of the string could vary. For example:
START|one|two|three|four|five|six|seven
START|one|two|three|four|five|six|seven|eight|nine
START|one|two|three|four
I want to replace in the third occurence of string with another... (9 Replies)
Discussion started by: som.nitk
9 Replies
4. Shell Programming and Scripting
echo "1337124526" | perl -pe 's/(\d+)/easttime($1)/e'
the above gives a date and time.
how can i subtract the date and time given by this command, from the current present date?
can this be a one liner or as close to a one-liner as possible? (1 Reply)
Discussion started by: SkySmart
1 Replies
5. Shell Programming and Scripting
Hi there, I have an example basic script (below) and ive been trying to figure out how to stop multiple arguments to my options occuring. for example using the example script below I can issue two arguments for, say the --surname option and it will not barf at me (although thats what i want it to... (11 Replies)
Discussion started by: rethink
11 Replies
6. Shell Programming and Scripting
Hi ,
I am using getopt for both short and long options as below
SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval set -- "$OPTS"
while ; do
case $1 in
-a|--alpha)
echo "-a or --alpha... (1 Reply)
Discussion started by: padmisri
1 Replies
7. Shell Programming and Scripting
Hi ,
I am using getopt for both short and long options as below
SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval set -- "$OPTS"
while ; do
case $1 in
-a|--alpha)
echo "-a or --alpha... (1 Reply)
Discussion started by: padmisri
1 Replies
8. Shell Programming and Scripting
Hi ,
I am using getopt for both short and long options as below
SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval set -- "$OPTS"
while ; do
case $1 in
-a|--alpha)
echo "-a or --alpha... (0 Replies)
Discussion started by: padmisri
0 Replies
9. Shell Programming and Scripting
Hi,
I have a perl script with two functions say func a and func b.
sub a {
-----------
---------
}
sub b {
---------
---------
}
I want to use this function on command line as we can do in shell script using getopt.
My motto here is to run the script like this
... (7 Replies)
Discussion started by: namishtiwari
7 Replies
10. Shell Programming and Scripting
I'm trying to make this long line of codes in Perl looks nice by dividing it into 2 lines...
Before:
`echo "blahblahblahblahblahblahblahblahblahblahblah" > ~/lalala/lalala/lalala/lalala/lalala/abc`;
After:
`echo "blahblahblahblahblahblahblahblahblahblahblah" >
... (5 Replies)
Discussion started by: teiji
5 Replies