If i have a variable which is a decimal number, i.e 34.05 How can you make decimal point fall on the 15th character on the screen? Or any other that you can specify? Can you do it using sed or awk? (3 Replies)
If in a script I am taking an input (R201) for example and assigning it to a variable, how would I change the R to uppercase if it was keyed in as r201? I can't seem to get it to work with toupper (4 Replies)
should be a simple question, I am trying to uppercase every first character in a word on the list.
abc
google
cnn
services
My first thought was sed 'y/^/^/', but it changed all the characters, not just the first character.
any thoughts? (7 Replies)
I need a script that reads the out put of a command (softwareupdate --list) and will tally up the number of asterisks in the output and tell me how many there were. How do I go about getting my script to treat asterisks as a regular character and not a wildcard or some other operator? (8 Replies)
Another frustrating scripting problem from a biologist trying to manipulate a file with several millions line. For each of the line I need to compare the uppercase A or C or G or T with the lowercase a or c or g or t. If there are more uppercases, a + should be added to a new column, otherwise a -... (10 Replies)
I decided I wanted to have the cd command print my full working directory after each cd command, so I put this cw command in .bashrc as a function.
cw ()
{
cd "${1}"
pwd
}While this works I would like pwd to print escapes when a space in a directory name exists. This would... (7 Replies)
I want to make the first character of some words to be uppercase. I have a file like the one below.
uid,givenname,sn,cn,mail,telephonenumber
mattj,matt,johnson,matt johnson,mattj@gmail.com
markv,mark,vennet,matt s vennet,markv@gmail.com
mikea,mike,austi,mike austin,mike@gmail.com
I want... (3 Replies)
Hi,
I am writing a shell script where I want that # should be added in all those lines as the first character where the pattern matches.
file has lot of functions defined
a.sh
#!/bin/bash
fn a {
beautiful evening
sunny day
}
fn b {
}
fn c {
hello world .its a beautiful day
... (12 Replies)
I have a file name :
var=UsrAccChgRpt
I want to make them upper case.
Tried:
$var | tr
Error:
tr: Invalid combination of options and Strings.
Usage: tr | -ds | -s | -ds | -s ] String1 String2
tr { -d | -s | -d | -s } String1
Could you please help. I am using AIX... (2 Replies)
Discussion started by: digioleg54
2 Replies
LEARN ABOUT DEBIAN
validation::class::errors
Validation::Class::Errors(3pm) User Contributed Perl Documentation Validation::Class::Errors(3pm)NAME
Validation::Class::Errors - Error Handling Object for Fields and Classes
VERSION
version 7.70
SYNOPSIS
package SomeClass;
use Validation::Class;
package main;
my $class = SomeClass->new;
...
# errors at the class-level
my $errors = $class->errors ;
print $errors->to_string;
# errors at the field-level
my $field_errors = $user->fields->{name}->{errors} ;
print $field_errors->to_string;
1;
DESCRIPTION
Validation::Class::Errors is responsible for error handling in Validation::Class derived classes on both the class and field levels
respectively.
METHODS
new
my $self = Validation::Class::Errors->new;
add
$self = $self->add("houston, we have a problem", "this isn't cool");
all
my @list = $self->all;
clear
$self = $self->clear;
count
my $count = $self->count;
each
my $list = $self->each(sub{ ucfirst lc shift });
list
my $list = $self->list;
find
my @matches = $self->find(qr/password/);
first
my $item = $self->first;
my $item = $self->first(qr/password/);
join
my $string = $self->join; # returns "an error, another error"
my $string = $self->join($delimiter);
to_string
The to_string method stringifies the errors using the specified delimiter or ", " (comma-space) by default.
my $string = $self->to_string; # returns "an error, another error"
my $string = $self->to_string($delimiter, sub { ucfirst lc shift });
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::Errors(3pm)