Sponsored Content
Top Forums Shell Programming and Scripting The scope of the shell/perl script is to read the input text file. Validate the expiry date of each Post 302516010 by methyl on Thursday 21st of April 2011 10:43:28 AM
Old 04-21-2011
What Operating System and version are you running?
What Shell do you use?
What version of "perl" (if any) do you have?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to input username on text file into finger command on shell script

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

Need to validate a date input format

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

Expiry date of shell script

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

How to read the data from the text file in shell script?

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

need shell or Perl script to read multiple input

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

Need script to validate file according to date

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

[Solved] Read and validate input arguments

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

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

9. UNIX for Dummies Questions & Answers

Inserting shell script input data automatically from a text file

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

How to get the shell script to read the .txt file as an input/data?

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
Attribute::Params::Validate(3)				User Contributed Perl Documentation			    Attribute::Params::Validate(3)

NAME
Attribute::Params::Validate - Define validation through subroutine attributes VERSION
version 1.08 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 everything that Params::Validate does except for the "validate" and "validate_pos" subroutines. ATTRIBUTES o Validate This attribute corresponds to the "validate" subroutine in Params::Validate. o ValidatePos This attribute corresponds 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> and Ilya Martynov <ilya@martynov.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by Dave Rolsky and Ilya Martynov. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.18.2 2017-10-06 Attribute::Params::Validate(3)
All times are GMT -4. The time now is 07:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy