09-02-2018
Seems you are missing a $ in your code?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a problem using bash. Simply, I cannot find the right command (if there's one!) to enter in the "- Arch_02 -" directory. As you can see, the name begins with a hyphen and this is causing some trouble:
localhost arch2 # pwd
/mnt/arch2
localhost arch2 # ls -l
total 4
dr-x------ 1 root... (3 Replies)
Discussion started by: robotronic
3 Replies
2. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
3. UNIX for Advanced & Expert Users
we're seeing very strange "No such file or directory" errors on NFS volumes on one of our suse servers - can anyone please help?
we're seeing it for both our NetApp NAS Device and one of our Solaris NFS servers too
Here is what we're seeing:
stg-backup:~ # cd /rmt/sge
stg-backup:/rmt/sge... (3 Replies)
Discussion started by: fishsponge
3 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. UNIX for Advanced & Expert Users
I've posted about this before, but only recently narrowed the problem down to a specific cause.
Ok, first of all, the behavior:
It occurs when autocompletion brings up its list (not when there is only a single option). Basically, if I were to type, say,
cd ~/<TAB>
I would get something... (2 Replies)
Discussion started by: marshaul
2 Replies
6. Shell Programming and Scripting
Hi All,
I have just now started learning awk from the source - Awk - A Tutorial and Introduction - by Bruce Barnett
and the bad part is that I am stuck on the very first example for running the awk script.
The script is as -
#!/bin/sh
# Linux users have to change $8 to $9
awk '
BEGIN ... (6 Replies)
Discussion started by: csrohit
6 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing To e-mail address
and column 3 contains cc e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Look at the following data file(cou.data) which has four fields separated by tab.
Four fields are country name, land area, population, continent where it belongs.
As for country name or continent name which has two words, two words are separated by space.
(Data are not accurately... (1 Reply)
Discussion started by: chihuyu
1 Replies
9. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
formvalidator::simple::results
FormValidator::Simple::Results(3pm) User Contributed Perl Documentation FormValidator::Simple::Results(3pm)
NAME
FormValidator::Simple::Results - results of validation
SYNOPSIS
my $results = FormValidator::Simple->check( $req => [
name => [qw/NOT_BLANK ASCII/, [qw/LENGTH 0 10/] ],
email => [qw/NOT_BLANK EMAIL_LOOSE/, [qw/LENGTH 0 30/] ],
] );
if ( $results->has_error ) {
foreach my $key ( @{ $results->error() } ) {
foreach my $type ( @{ $results->erorr($key) } ) {
print "invalid: $key - $type
";
}
}
}
DESCRIPTION
This is for handling resuls of FormValidator::Simple's check.
This object behaves like Data::FormValidator's results object, but has some specific methods.
CHECK RESULT
has_missing
If there are missing values ( failed in validation 'NOT_BLANK' ), this method returns true.
if ( $results->has_missing ) {
...
}
has_invalid
If there are invalid values ( failed in some validations except 'NOT_BLANK' ), this method returns true.
if ( $results->has_invalid ) {
...
}
has_error
If there are missing or invalid values, this method returns true.
if ( $results->has_error ) {
...
}
success
inverse of has_error
unless ( $resuls->success ) {
...
}
ANALYZING RESULTS
missing
no argument
When you call this method with no argument, it returns keys failed 'NOT_BLANK' validation.
my $missings = $results->missing;
foreach my $missing_data ( @$missings ) {
print $missing_data, "
";
}
# -- print out, for example --
# name
# email
key When you call this method with key-name, it returnes true if the value of the key is missing.
if ( $results->missing('name') ) {
print "name is empty!
";
}
invalid
no argument
When you call this method with no argument, it returns keys that failed some validation except 'NOT_BLANK'.
my $invalids = $results->invalid;
foreach my $invalid_data ( @$invalids ) {
print $invalid_data, "
";
}
# -- print out, for example --
# name
# email
key When you call this method with key-name, it returns names of failed validation.
my $failed_validations = $results->invalid('name');
foreach my $validation ( @$failed_validations ) {
print $validation, "
";
}
# -- print out, for example --
# ASCII
# LENGTH
key and validation-name
When you call this method with key-name, it returns false if the value has passed the validation.
if ( $results->invalid( name => 'LENGTH' ) ) {
print "name is wrong length!
";
}
error
This doesn't distinguish 'missing' and 'invalid'. You can use this like 'invalid' method, but this consider 'NOT_BLANK' same as other
validations.
my $error_keys = $results->error;
my $failed_validation = $resuls->error('name');
# this includes 'NOT_BLANK'
if ( $results->error( name => 'NOT_BLANK' ) ) {
print "name is missing!
";
}
if ( $results->error( name => 'ASCII' ) ) {
print "name should be ascii code!
";
}
SEE ALSO
FormValidator::Simple
AUTHOR
Lyo Kato <lyo.kato@gmail.com>
COPYRIGHT AND LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.
perl v5.14.2 2011-12-08 FormValidator::Simple::Results(3pm)