Maybe this will help as it illustrates parsing a line on a delimiter and assigning the values to variables which are then check for null. It saves you some processes and command substitutions too. It does not strip the double-quotes as you seem to just want to test for the presence of something in that field position (you should really make sure its a number, and thus a valid count, etc).
I am trying to validate user input, at the moment what i have is as below :-
echo "\n\tPlease, enter package name to import: \c"
read PACKAGE
So far this works perfect , But if the user does not input any thing it stalls :(
What I need is, If the user does not enter the name of the... (9 Replies)
Hi guys!
Im tryin to set up a login script that allows a user to login with only the following "forename.surname" .
The username all contain lowercase letters so thats not a problem to sort out, but im having problems making sure that they can only enter 1 " . " . the code i have so far is this... (1 Reply)
I'm kinda new in shell scripting. How do i validate an input from a user to conform to requirement. For example,
echo "Enter First Name: "
read FName
echo "Enter Date of Employment (dd/mm/yyyy): "
read DoE
If the user enters data that is alphanumeric, it accepts it. I hope i've... (1 Reply)
I am validating a form using php script and I want to "echo" the error message near to the text box itself & not below all the controls....Can I Position the display messages ?..Pls help me... (2 Replies)
Hi,
I am new to Unix shell scripting and need help to add some validation to an existing script.
I've made a script that takes two argument (input) but I want the script to display an error message when nothing (null) is entered. So far I managed to validate the fist argument but fail to... (2 Replies)
Hi All,
I need to write a small piece of code to check the following.
name should contain (A-Z), spaces, hyphens & apostrophes
I need to generate regular expressions for the same.
Please help me out as i am not familiar with regular expressions. (1 Reply)
Hey people, I got small little error which says I entered too many argument in the if else list.
The stock contains a list of information.
The 4th field consist of the quantity available, so I'm trying to alert the user that the stock is less than 3 and needed to restock.
Is this the correct way... (7 Replies)
Hi there,
As a part of file validation, I needed to check for delimiter count in the file.
My aim is to find, how many records have failed to have predefined numbers of delimiters in the file.
My code looks like below
i=`awk -F '|' 'NF != 2 {print NR, $0} ' ${pinb_fldr}/${pfile}DAT |... (3 Replies)
Hi All
I am trying to validate a value using if condition
requirement is need to check whether its a valid numeric value
the input contains ( space, #N/A and negative and positive decimal values and Zeros)
if it contains the space, I need to display the error message as space
... (15 Replies)
I am learning Shell scripting on own. I am trying to do an assignment to get details from the user like username their individual marks ,DOB and send a report in mail with the Details calculated like total and average.
validate_marks() {
local Value=$1
if &&
then
return 0
else... (1 Reply)
Discussion started by: JayashreeRobin
1 Replies
LEARN ABOUT DEBIAN
validation::class::collection
Validation::Class::Collection(3pm) User Contributed Perl Documentation Validation::Class::Collection(3pm)NAME
Validation::Class::Collection - Generic Container Class for Various Collections
VERSION
version 7.70
SYNOPSIS
use Validation::Class::Collection;
my $foos = Validation::Class::Collection->new;
$foos->add(foo => Foo->new);
print $foos->count; # 1 object
DESCRIPTION
Validation::Class::Collection provides an all-purpose container for hash objects. This class is primarily used as a base class for
collection management classes.
METHODS
new
my $self = Validation::Class::Collection->new;
add
$self = $self->add(foo => Foo->new);
$self->add(foo => Foo->new, bar => Bar->new);
clear
$self = $self->clear;
count
my $count = $self->count;
each
$self = $self->each(sub{
my ($name, $object) = @_;
...
});
find
my $matches = $self->find(qr/update_/); # hashref
get
my $object = $self->get($name);
has
if ($self->has($name)) {
...
}
hash
my $hash = $self->hash;
keys
my @keys = $self->keys;
list
my @objects = $self->list;
remove
$object = $self->remove($name);
values
my @objects = $self->values;
AUTHOR
Al Newkirk <anewkirk@ana.io>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Al Newkirk.
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.14.2 2012-06-28 Validation::Class::Collection(3pm)