10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
There is a file name list_filenames.dat, this has all the list of all files I need to encrypt, I did not understand what the following syntax is doing:
grep -s "^$1" list_filenames.dat, when I manually run this command it just returns all the lines, what is the usage of this ? can someone... (4 Replies)
Discussion started by: okkadu
4 Replies
2. Homework & Coursework Questions
Use and complete the template provided. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have to find all the files where the function sequentialInsert is called and the directory is ~cs252/Assignments/commandsAsst/project
2.... (2 Replies)
Discussion started by: jennkat
2 Replies
3. AIX
How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies
4. Shell Programming and Scripting
what is the grep command to get the second occurence of pattern in a file
or how to do with sed ? (1 Reply)
Discussion started by: santosh1234
1 Replies
5. Shell Programming and Scripting
Hi all,
I have a file resp_cde.ats which has values as:-
APPDIR=C:\Program Files\Cogny\cert
PUBSDIR=C:\Program Files\Cognoy\cert\documentation
TOURDIR=C:\Program Files\Cognoy\cert\tour
DATADIR=C:\Program Files\Cognoy\cert\data
Now I use the grep command in a shell script:-
x=`grep... (2 Replies)
Discussion started by: vikasrout
2 Replies
6. UNIX for Advanced & Expert Users
my file contains
xxabced.p dlksfad;
dflsdkjflkds flksdjflkdioewf
erfsdlkfjsdla;
dlkfjsd;lfkj msgdadf.p dslk kdjflksdjfl;asdfasdfjkljl
fdsf;jd ppuskldf.p
i want the output is
xxabced.p
msgdadf.p
ppuskldf.p
Can any one give the command? (1 Reply)
Discussion started by: kingganesh04
1 Replies
7. HP-UX
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I am trying to use grep to locate multiple uses of the same word in the same line. The word has to be 3+ char, upper or lower or both.
I tried this code
<code>
grep \({3,}\)*\1 i*
</code>
and i turned out zero results. Any ideas?
____________________________________________... (5 Replies)
Discussion started by: Omega1589
5 Replies
9. UNIX for Advanced & Expert Users
grep can filter the text which want to display, but if I want it do not show the text specific in grep, how to do? thk a lot! (2 Replies)
Discussion started by: zp523444
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have one basic doubt, that using grep command frequently , will it have direct impact on the CPU load, pls clarify
for eg, if i run a non stop script containing while loop to grep some parameters, what will be the load in CPU..
thanks (3 Replies)
Discussion started by: vasikaran
3 Replies
Email(3pm) User Contributed Perl Documentation Email(3pm)
NAME
Data::Validate::Email - common email validation methods
SYNOPSIS
use Data::Validate::Email qw(is_email is_email_rfc822);
if(is_email($suspect)){
print "Looks like an email address
";
} elsif(is_email_rfc822($suspect)){
print "Doesn't much look like an email address, but passes rfc822
";
} else {
print "Not an email address
";
}
# or as an object
my $v = Data::Validate::Email->new();
die "not an email" unless ($v->is_email('foo'));
DESCRIPTION
This module collects common email validation routines to make input validation, and untainting easier and more readable.
All functions return an untainted value if the test passes, and undef if it fails. This means that you should always check for a defined
status explicitly. Don't assume the return will be true. (e.g. is_username('0'))
The value to test is always the first (and often only) argument.
FUNCTIONS
new - constructor for OO usage
new([\%opts]);
Description
Returns a Data::Validator::Email object. This lets you access all the validator function calls as methods without importing them
into your namespace or using the clumsy Data::Validate::Email::function_name() format.
Arguments
An optional hash reference is retained and passed on to other function calls in the Data::Validate module series. This module does
not utilize the extra data, but some child calls do. See Data::Validate::Domain for an example.
Returns
Returns a Data::Validate::Email object
is_email - is the value a well-formed email address?
is_email($value);
Description
Returns the untainted address if the test value appears to be a well-formed email address. This method tries to match real-world
addresses, rather than trying to support everything that rfc822 allows. (see is_email_rfc822 if you want the more permissive
behavior.)
In short, it pretty much looks for something@something.tld. It does not understand real names ("bob smith" <bsmith@test.com>), or
other comments. It will not accept partially-qualified addresses ('bob', or 'bob@machine')
Arguments
$value
The potential address to test.
Returns
Returns the untainted address on success, undef on failure.
Notes, Exceptions, & Bugs
This function does not make any attempt to check whether an address is genuinely deliverable. It only looks to see that the format
is email-like.
The function accepts an optional hash reference as a second argument to change the validation behavior. It is passed on unchanged
to Neil Neely's Data::Validate::Domain::is_domain() function. See that module's documentation for legal values.
is_email_rfc822 - does the value look like an RFC 822 address?
is_email_rfc822($value);
Description
Returns the untainted address if the test value appears to be a well-formed email address according to RFC822. Note that the
standard allows for a wide variety of address formats, including ones with real names and comments.
In most cases you probably want to use is_email() instead. This one will accept things that you probably aren't expecting
('foo@bar', for example.)
Arguments
$value
The potential address to test.
Returns
Returns the untainted address on success, undef on failure.
Notes, Exceptions, & Bugs
This check uses Casey West's Email::Address module to do its validation.
The function does not make any attempt to check whether an address is genuinely deliverable. It only looks to see that the format
is email-like.
is_domain - does the value look like a domain name?
is_domain($value);
Description
Returns the untainted domain if the test value appears to be a well-formed domain name. This test uses the same logic as
is_email(), rather than the somewhat more permissive pattern specified by RFC822.
Arguments
$value
The potential domain to test.
Returns
Returns the untainted domain on success, undef on failure.
Notes, Exceptions, & Bugs
The function does not make any attempt to check whether a domain is actually exists. It only looks to see that the format is
appropriate.
As of version 0.03, this is a direct pass-through to Neil Neely's Data::Validate::Domain::is_domain() function.
The function accepts an optional hash reference as a second argument to change the validation behavior. It is passed on unchanged
to Neil Neely's Data::Validate::Domain::is_domain() function. See that module's documentation for legal values.
is_username - does the value look like a username?
is_username($value);
Description
Returns the untainted username if the test value appears to be a well-formed username. More specifically, it tests to see if the
value is legal as the username component of an email address as defined by is_email(). Note that this definition is more
restrictive than the one in RFC822.
Arguments
$value
The potential username to test.
Returns
Returns the untainted username on success, undef on failure.
Notes, Exceptions, & Bugs
The function does not make any attempt to check whether a username actually exists on your system. It only looks to see that the
format is appropriate.
AUTHOR
Richard Sonnen <sonnen@richardsonnen.com>.
COPYRIGHT
Copyright (c) 2004 Richard Sonnen. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2009-02-01 Email(3pm)