10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
HELLO
I need your help please , i need to read a file that contain a table like :
Name | Status
------------------
DB 1 | UP
DB 2 | UP
DB 3 | DOWN
DB 4 | UP
DB 5 | UP
the objective to read each line and check if DB is UP or Down and give me the name of Down database.... (10 Replies)
Discussion started by: Abdellah
10 Replies
2. UNIX for Beginners Questions & Answers
Hi there,
I currently use the following find command to recursively search all the subdirectories in our file system for a table ( in this case BB_TENURE_DAYS)
find -type f -exec grep -l "BB_TENURE_DAYS" {} \+
So I have this so far - the problem is how do I read the line to get the... (2 Replies)
Discussion started by: rjsha1
2 Replies
3. Shell Programming and Scripting
Hey guyz,
I have a table like this:
1 A=#;B=#;C=#
2 A=#;C=#;D=#;E=#;E=#
3 B=#;B=#;B=#;D=#
# are just some numbers. I want to have the output like this:
* 1 2 3
A # # NA
B # NA #
C # # NA
D NA # #
E NA # NA
So basically, I wanna know in each of the rows in my input (which... (9 Replies)
Discussion started by: @man
9 Replies
4. Shell Programming and Scripting
Dear forum users,
i'm trying to read a table with 40x122 data in a array. Following this, i'd plot each rows again the header of the file in gnuplot.
i was thinking for something like that
#!/bin/bash
# reads from the $ips file and assigns to $MYARRAY
#IFS =";" split the line after the... (6 Replies)
Discussion started by: servuskelb
6 Replies
5. HP-UX
Hi all,
Could someone please explain to me how I should read this routing table,
# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 32808
10.222.47.82 10.222.47.82 UH... (3 Replies)
Discussion started by: rachael
3 Replies
6. Solaris
Hi all!
Solaris 10.
Why did X-server stop to read OWfontpath?
Any suggestions.
Thanks. (0 Replies)
Discussion started by: wolfgang
0 Replies
7. Red Hat
Hello,
I'm experimenting a problem on my rh server.
Red Hat Enterprise Linux AS release 3 (Taroon Update 8)
2.4.21-47.ELsmp #1 SMP i686 i686 i386 GNU/Linux
It started with a segmentation fault on
#id root
To resolve it, I've installed
coreutils-4.5.3-28.4.i386.rpm
But, I... (6 Replies)
Discussion started by: gogol_bordello
6 Replies
8. UNIX for Dummies Questions & Answers
i have to read some data from a teradata table and use them in my shell script.. how do i do that.. we can use BTEQ .. but i don know how to pass the field values as variables to the shell.. please help me.... (8 Replies)
Discussion started by: depakjan
8 Replies
9. Shell Programming and Scripting
I have korn shell scripts.
I want to pass a variable to a script which will execute a a sql script to read a table that contains env. variables. I want to read and then somehow export at unix level variables
example
for every row selected from the table build export command line
field1... (5 Replies)
Discussion started by: TimHortons
5 Replies
10. UNIX for Dummies Questions & Answers
Hi!
I've just started learning shell scripting, and have been somewhat 'thrown in at the deep-end and told to swim' so excuse my complete lack of knowledge and ignorance, but here goes...
I've been given a unix script to 'tidy up'. Basically the script consists of the few lines of code being... (2 Replies)
Discussion started by: Sn33R
2 Replies
Moose::Cookbook::Meta::Table_MetaclassTrait(3pm) User Contributed Perl Documentation Moose::Cookbook::Meta::Table_MetaclassTrait(3pm)
NAME
Moose::Cookbook::Meta::Table_MetaclassTrait - Adding a "table" attribute as a metaclass trait
VERSION
version 2.0603
SYNOPSIS
# in lib/MyApp/Meta/Class/Trait/HasTable.pm
package MyApp::Meta::Class::Trait::HasTable;
use Moose::Role;
Moose::Util::meta_class_alias('HasTable');
has table => (
is => 'rw',
isa => 'Str',
);
# in lib/MyApp/User.pm
package MyApp::User;
use Moose -traits => 'HasTable';
__PACKAGE__->meta->table('User');
DESCRIPTION
In this recipe, we'll create a class metaclass trait which has a "table" attribute. This trait is for classes associated with a DBMS table,
as one might do for an ORM.
In this example, the table name is just a string, but in a real ORM the table might be an object describing the table.
THE METACLASS TRAIT
This really is as simple as the recipe "SYNOPSIS" shows. The trick is getting your classes to use this metaclass, and providing some sort
of sugar for declaring the table. This is covered in Moose::Cookbook::Extending::Debugging_BaseClassRole, which shows how to make a module
like "Moose.pm" itself, with sugar like "has_table()".
Using this Metaclass Trait in Practice
Accessing this new "table" attribute is quite simple. Given a class named "MyApp::User", we could simply write the following:
my $table = MyApp::User->meta->table;
As long as "MyApp::User" has arranged to apply the "MyApp::Meta::Class::Trait::HasTable" to its metaclass, this method call just works. If
we want to be more careful, we can check that the class metaclass object has a "table" method:
$table = MyApp::User->meta->table
if MyApp::User->meta->can('table');
In theory, this is not entirely correct, since the metaclass might be getting its "table" method from a different trait. In practice, you
are unlikely to encounter this sort of problem.
RECIPE CAVEAT
This recipe doesn't work when you paste it all into a single file. This is because the "use Moose -traits => 'HasTable';" line ends up
being executed before the "table" attribute is defined.
When the two packages are separate files, this just works.
SEE ALSO
Moose::Cookbook::Meta::Labeled_AttributeTrait - Labels implemented via attribute traits
AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for
details.
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc..
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 Moose::Cookbook::Meta::Table_MetaclassTrait(3pm)