I was wondering can anyone give me a clue how to start script which would do the following:
I have 2 numbers as input for example: 100 and 1000 and I need to create file and in that file should be written
100 - 199
200 - 299
300 - 399
400 - 499
500 - 599
600 - 699
700 - 799... (3 Replies)
does any one have any ideas how i would go about calculating the number of days left in the month from a bash script ?. I want to do some operations on a csv file according to the result (8 Replies)
I need a script to figure out if a user's last login was 90 days or older. OS=AIX 5.3, shell=Korn
Here's what I have so far:
====
#!/usr/bin/ksh
NOW=`lsuser -a time_last_login root | awk -F= '{ print $2 }'`
(( LAST_LOGIN_TIME = 0 ))
(( DIFF = $NOW - $LAST_LOGIN_TIME ))
lsuser -a... (3 Replies)
Hi Guys,
I was working some time ago n was in need to calculate date 30/31 days from today including Feb (Leap yr stuff). Today date is variable depending on day of execution of script. I tried searching but was not able to get exactly what I needed....So at that I time I implemented by my own... (3 Replies)
Hello,
I'm trying to create a shell script (#!/bin/sh) which should tell me the age of a file in minutes...
I have a process, which delivers me all 15 minutes a new file and I want to have a monitoring script, which sends me an email, if the present file is older than 20 minutes.
To do... (10 Replies)
I extract dates from the log file and need to calculate days between two dates. My dates are in yyyyMmmdd format. Example:
$d1=2011 Oct 21
$d2=2012 Feb 20
I need to calculate the number of days between $d2 and $d1. This is on Solaris.
Any ideas?
Thanks,
djanu (4 Replies)
I am unable to get this KSH script to work. Can someone help. I've been told this should work with KSH93. Which I think I have on Solaris 10.
If I do a grep -i version /usr/dt/bin/dtksh I get
@(#)Version M-12/28/93d
@(#)Version 12/28/93
@(#)Version M-12/28/93
This is correct for... (5 Replies)
I wrote the day calculator also in bash. I would like to now, that is it good so?
#!/bin/bash
datum1=`date -d "1991/1/1" "+%s"`
datum2=`date "+%s"`
diff=$(($datum2-$datum1))
days=$(($diff/(60*60*24)))
echo $days
Thanks in advance for your help! (3 Replies)
Hi,
I have one .csv file. I have 2 date columns present in file, column 2 and column 3.
I need to calculate how many days exist between 2 dates.
I am trying to subtract date column 2 from date column 3.
Eg: my file look likes
s.no, Start_date,End_Date
1, 7/29/2012,10/27/2012
2,... (9 Replies)
Discussion started by: Dimple
9 Replies
LEARN ABOUT SUSE
glib::optioncontext
Glib::OptionContext(3) User Contributed Perl Documentation Glib::OptionContext(3)NAME
Glib::OptionContext
SYNOPSIS
my ($verbose, $source, $filenames) = ('', undef, []);
my $entries = [
{ long_name => 'verbose',
short_name => 'v',
arg_type => 'none',
arg_value => $verbose,
description => 'be verbose' },
{ long_name => 'source',
short_name => 's',
arg_type => 'string',
arg_value => $source,
description => 'set the source',
arg_description => 'source' },
[ 'filenames', 'f', 'filename-array', $filenames ],
];
my $context = Glib::OptionContext->new ('- urgsify your life');
$context->add_main_entries ($entries, 'C');
$context->parse ();
# $verbose, $source, and $filenames are now updated according to the
# command line options given
HIERARCHY
Glib::Boxed
+----Glib::OptionContext
METHODS
optioncontext = Glib::OptionContext->new ($parameter_string)
o $parameter_string (string)
$context->add_group ($group)
o $group (Glib::OptionGroup)
$context->add_main_entries ($entries, $translation_domain)
o $entries (scalar) reference to an array of option entries
o $translation_domain (string)
boolean = $context->get_help_enabled
$context->set_help_enabled ($help_enabled)
o $help_enabled (boolean)
boolean = $context->get_ignore_unknown_options
$context->set_ignore_unknown_options ($ignore_unknown)
o $ignore_unknown (boolean)
optiongroup = $context->get_main_group
$context->set_main_group ($group)
o $group (Glib::OptionGroup)
boolean = $context->parse
This method works directly on @ARGV.
May croak with a Glib::Error in $@ on failure.
SEE ALSO
Glib, Glib::Boxed
COPYRIGHT
Copyright (C) 2003-2009 by the gtk2-perl team.
This software is licensed under the LGPL. See Glib for a full notice.
perl v5.12.1 2010-07-05 Glib::OptionContext(3)