04-21-2011
thanks for your reply pludi
This is the requirement I got from my management to validate the expiry date. Please help me
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to clean up my server and I have the list of some "special" users stored on the text file like this
Now I want to write a shell script to finger all of them so I can have some kind of ideas who they are but here comes the problem....I completely forgot how to do it with shell... (3 Replies)
Discussion started by: Micz
3 Replies
2. Shell Programming and Scripting
Hi all,
I have a shell script(K shell) which takes a date as input.
i want the input to be in DD-MM-YYYY format.
Can i enforce such a format of input string using just one line of code?
OR
do i need to parse the input date into different components and test them using Case statements... (2 Replies)
Discussion started by: rajugp1
2 Replies
3. Shell Programming and Scripting
Hello folks,
I have question about my expiry of shell script, today date is 2009-11-11, i will have to deploy a script today, how i should setup that my script will not work after 2010-05-11, Between if someone will change the date of server then script will again not work, please give... (3 Replies)
Discussion started by: learnbash
3 Replies
4. Shell Programming and Scripting
I am having one text file and i need to read that data from my shell script.
I will expain you the scenario:
Script look like:
For name type 1:
For age type 2:
For Salary type3:
echo "Enter the input:"
read the data
if input is 1 then go to the Text file and print the... (2 Replies)
Discussion started by: dineshmurs
2 Replies
5. Shell Programming and Scripting
I need shell 0r Perl script to read multiple input and do something and come out
example:
echo “ enter the host names separated by space “
read servers
foreach @servers
{ do
do something
done}
Here host names like host1 host2 host3 . . . . . . . so on
Please help me... (8 Replies)
Discussion started by: sreedhargouda
8 Replies
6. Shell Programming and Scripting
Hi All,
I am very new to unix and just started to work with unix and shell scripting.I have a query anyone help would be much appreciated
I am using sun solaris OS
I want to validate a file according to its date and if validate successful then it would write the file name,size,date and... (3 Replies)
Discussion started by: sv0081493
3 Replies
7. Shell Programming and Scripting
Hi,
I need to get input arguments, as well as validate them. This is how I'm reading them:
#!/bin/bash
args="$@" # save arguments to variable
## Read input arguments, if so
while ; do
case $1 in
-v | --verbose ) verbose=true;;
-z | --gzip ) compression="gz";;
... (3 Replies)
Discussion started by: AlbertGM
3 Replies
8. UNIX for Dummies Questions & Answers
sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies
9. UNIX for Dummies Questions & Answers
Dear experts,
I am new to linux programming. I have a shell script which i should run it on all my samples.
I only define input and out put for this script. The inputs are 3 numbers(coordination numbers) which are available in a series of text file.
Since i have a lots of samples, it takes a... (5 Replies)
Discussion started by: mohamadreza
5 Replies
10. Shell Programming and Scripting
i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Discussion started by: Gurdza32
11 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)