Hi friends, :)
In a shell script i found the following if condition.
echo -n "Which version of $1 do you want to restore ('0' to quit)? : "
read desired
if ${desired:=1} -ge $index ] ; then
echo "$0: Restore canceled by user: index value too big." >&2
exit 1
fi
Can... (1 Reply)
i have a paramter data_date in which i am passing a string value.i want to find out another paramter file_date from this.the logic is given below
if day of data_date = sunday or monday
then
file_date=data_date-1
else
file_date=data_date-2
i am passing data_date as 20061027.
how can i... (3 Replies)
Hi,
I am trying to execute this command, but is it not working, says "`;' unexpected"
eval $lgrep $SAM_CMD ; if ; then ; echo "No Error" ; fi
What i want is, return the command output, if it is non zero, say "No Error".
Thanks, John. (21 Replies)
Hi
I have to evaluate multiple conditions with an 'or'.
Here is an example:
if
when i use the above i get a error message
'
Please help me to know if i am missing something in the syntax.
how do i achieve multiple "or" in the same if condition.
Thanks. (11 Replies)
Executed the following if conditions .. and got different results .
only (( )) gave correct o/p with all scenarios .
Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition.
And why each condition gave different result.
1.... (2 Replies)
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if ]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if ]; ... (2 Replies)
Hi all
Unix newbie - please be gentle
Am modifying an existing script to error trap a variable with a length of 0
#!/bin/bash
ipfile='/var/data/bin/ipaddress'
] && ipold="$(< "$ipfile" )"
ipnew="$( wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //;s/<.*$//' )"
#... (6 Replies)
o/p of my command is given below
My requirement is
if Pnumber is 0 then
stabilization.Build.2013
else
stabilization.PBuild.2013.3 (11 Replies)
Discussion started by: nikhil jain
11 Replies
LEARN ABOUT DEBIAN
dbix::class::helper::row::storagevalues
DBIx::Class::Helper::Row::StorageValues(3pm) User Contributed Perl Documentation DBIx::Class::Helper::Row::StorageValues(3pm)NAME
DBIx::Class::Helper::Row::StorageValues - Keep track of stored vs in-memory row values
VERSION
version 2.013002
SYNOPSIS
package MyApp::Schema::Result::BlogPost;
use parent 'DBIx::Class::Core';
__PACKAGE__->load_components(qw(Helper::Row::StorageValues));
__PACKAGE__->table('BlogPost');
__PACKAGE__->add_columns(
id => {
data_type => 'integer',
is_auto_increment => 1,
},
title => {
data_type => 'varchar',
length => 32,
keep_storage_value => 1,
},
body => {
data_type => 'text',
},
);
1;
# elsewhere:
my $post = $blog_rs->create({
title => 'Components for fun and profit',
body => '...',
});
$post->title('Components for fun');
warn sprintf 'Changing title from %s to %s',
$post->storage_value('title'), $post->title;
$post->update;
DESCRIPTION
This component keeps track of the value for a given column in the database. If you change the column's value and do not call "update", the
"storage_value" will be different; once "update" is called the "storage_value" will be set to the value of the accessor. Note that the
fact that it uses the accessor is an important distinction. If you are using DBIx::Class::FilterColumn or DBIx::Class::InflateColumn it
will get the non-storage or inflated values, respectively.
METHODS
_has_storage_value
$self->_has_storage_value('colname')
returns true if we should store the storage value from the database. Override this if you'd like to enable storage on all integers or
something like that:
sub _has_storage_value {
my ( $self, $column ) = @_;
my $info = $self->column_info($column);
return defined $info->{data_type} && $info->{data_type} eq 'integer';
}
storage_value_columns
$self->storage_value_columns
returns a list of columns to store
get_storage_value
$self->get_storage_value('colname')
returns the value for that column which is in storage
AUTHOR
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Arthur Axel "fREW" Schmidt.
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-18 DBIx::Class::Helper::Row::StorageValues(3pm)