This specification is absolutely unreadable! If I guess its meaning correctly, you have a number of files per timestamp, with the file number, the maximum file number, and the timestamp being part of the file name. You want to check if the count of files per timestamp is identical to the maximum file number. For this, try
If you can make sure that there's never MORE files than max no., this will do:
I am attempting to itterate through a file that has multiple lines and for each one read the entire line and use the value then to search in other files. The problem is that instead of an entire line I am getting each word in the file set as the value I am searching for. For example in File 1... (2 Replies)
Hello,
How do I write a korn shell that will rename file with the current date. What I want to do is, I have a file that is re-written every day. But instead, I want to keep a 14 day history of the file. So I want to write a script that will rename the current file with a date attached to the... (2 Replies)
Hello All,
I have come across a small problem. It would be great if any of you could help me in resolving the issue.
one file named dummy.txt will be ftped to Unix machine twice daily. If i receive it second time in a day i need to do some processing with the file.
How to find the... (2 Replies)
Hi,
I am new to this unix scripting, I got a requirement like..
Files with *.XML extension will be generating in a /home/sample/ folder for every 15 mins. I need to monitor those files in that particular folder for every hour.
If no file has been generated in that particular folder for an... (7 Replies)
The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
All,
Can anyone please help me with the below scenario in korn shell script.
Can anyone please give me some hints to proceed on this.
I have a Flat file of the below format.
Input file format:... (1 Reply)
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
Hi,
I am looking for a ready shell script that can help in loading and validating a high volume (around 4 GB) .Dat file . The data in the file has to be validated at each of its column, like the data constraint on each of the data type on each of its 60 columns and also a few other constraints... (2 Replies)
I want to write a korn shell script to get the latest three versions for a file in the directory having lot of files with various versions (files with prefix as same but time stamp as suffix) and compress it and at the same time have to remove the remaining versions of the file (other than latest... (4 Replies)
I am attempting to write a korn shell script that does the following, but I am getting errors. I'm new to korn shell scripting and am not sure what I am doing wrong. Please help with example scripts. Thanks.
1) check for day of the week
2) if day of the week is Monday then check for the... (4 Replies)
Discussion started by: ijmoore
4 Replies
LEARN ABOUT SUSE
attribute::params::validate
Attribute::Params::Validate(3) User Contributed Perl Documentation Attribute::Params::Validate(3)NAME
Attribute::Params::Validate - Validate method/function parameters using attributes
SYNOPSIS
use Attribute::Params::Validate qw(:all);
# takes named params (hash or hashref)
# foo is mandatory, bar is optional
sub foo : Validate( foo => 1, bar => 0 )
{
...
}
# takes positional params
# first two are mandatory, third is optional
sub bar : ValidatePos( 1, 1, 0 )
{
...
}
# for some reason Perl insists that the entire attribute be on one line
sub foo2 : Validate( foo => { type => ARRAYREF }, bar => { can => [ 'print', 'flush', 'frobnicate' ] }, baz => { type => SCALAR, callbacks => { 'numbers only' => sub { shift() =~ /^d+$/ }, 'less than 90' => sub { shift() < 90 } } } )
{
...
}
# note that this is marked as a method. This is very important!
sub baz : Validate( foo => { type => ARRAYREF }, bar => { isa => 'Frobnicator' } ) method
{
...
}
DESCRIPTION
The Attribute::Params::Validate module allows you to validate method or function call parameters just like Params::Validate does. However,
this module allows you to specify your validation spec as an attribute, rather than by calling the "validate" routine.
Please see Params::Validate for more information on how you can specify what validation is performed.
EXPORT
This module exports everthing that Params::Validate does except for the "validate" and "validate_pos" subroutines.
ATTRIBUTES
o Validate
This attribute corresponse to the "validate" subroutine in Params::Validate.
o ValidatePos
This attribute corresponse to the "validate_pos" subroutine in Params::Validate.
OO
If you are using this module to mark methods for validation, as opposed to subroutines, it is crucial that you mark these methods with the
":method" attribute, as well as the "Validate" or "ValidatePos" attribute.
If you do not do this, then the object or class used in the method call will be passed to the validation routines, which is probably not
what you want.
CAVEATS
You must put all the arguments to the "Validate" or "ValidatePos" attribute on a single line, or Perl will complain.
SEE ALSO
Params::Validate
AUTHOR
Dave Rolsky, <autarch@urth.org>
perl v5.12.1 2010-07-05 Attribute::Params::Validate(3)