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 DEBIAN
throwable::error
Throwable::Error(3pm) User Contributed Perl Documentation Throwable::Error(3pm)NAME
Throwable::Error - an easy-to-use class for error objects
VERSION
version 0.102080
SYNOPSIS
package MyApp::Error;
use Moose;
extends 'Throwable::Error';
has execution_phase => (
is => 'ro',
isa => 'MyApp::Phase',
default => 'startup',
);
...and in your app...
MyApp::Error->throw("all communications offline");
# or...
MyApp::Error->throw({
message => "all communications offline",
phase => 'shutdown',
});
DESCRIPTION
Throwable::Error is a base class for exceptions that will be thrown to signal errors and abort normal program flow. Throwable::Error is an
alternative to Exception::Class, the features of which are largely provided by the Moose object system atop which Throwable::Error is
built.
Throwable::Error performs the Throwable and StackTrace::Auto roles. That means you can call "throw" on it to create and throw n error
object in one call, and that every error object will have a stack trace for its creation.
ATTRIBUTES
message
This attribute must be defined and must contain a string describing the error condition. This string will be printed at the top of the
stack trace when the error is stringified.
stack_trace
This attribute, provided by StackTrace::Auto, will contain a stack trace object guaranteed to respond to the "as_string" method. For more
information about the stack trace and associated behavior, consult the StackTrace::Auto docs.
METHODS
as_string
This method will provide a string representing the error, containing the error's message followed by the its stack trace.
AUTHORS
o Ricardo SIGNES <rjbs@cpan.org>
o Florian Ragwitz <rafl@debian.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.10.1 2010-07-27 Throwable::Error(3pm)