01-05-2011
Script to create metas from a file
Hi,
I have a file containing around 652 devices id's , i need to print them in the following format.
form meta from dev 0001 , config=Striped; add dev 0002:0012 to meta 0001
test.txt
0001
0002
0003
-
0012
-
-
0652
can anyone help me to write a script for forming the meta with 12 device each to display as below:
form meta from dev 0001 , config=Striped; add dev 0002:0012 to meta 0001.
form meta from dev 0600 , config=Striped; add dev 0601:00611 to meta 0612
Last edited by praveen1516; 01-06-2011 at 02:49 AM..
Reason: to change the title
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello
have a file1
H87I
Y788O
T347U
J23U
and
file2 J23U U887Y I99U T556U
file3 I99O J99T F557J
file4 N99I T666U R55Y
file5 H87I T347U
file6 H77U R556Y E44T
file7 Y788O K98U H8I
May be using script we can use file1 to search for all the files
and have the output
H87I file5... (3 Replies)
Discussion started by: cdfd123
3 Replies
2. Shell Programming and Scripting
Need shell script to read two file at same time and print output in single file
Example I have two files 1) file1.txt 2) file2.txt
File1.txt contains
Aaa
Bbb
Ccc
Ddd
Eee
Fff
File2.txt contains
Zzz
Yyy
Xxx (10 Replies)
Discussion started by: sreedhargouda
10 Replies
3. Shell Programming and Scripting
AT
----------
0
Elapsed: 00:00:00.02
SO
----------
0
Elapsed: 00:00:00.01
SE
----------
0
Elapsed: 00:00:00.01
CR
---------- (4 Replies)
Discussion started by: sandy1028
4 Replies
4. Shell Programming and Scripting
Hi Friends,
I am new to this forum. Just struck up with a logic.
I have a csv file seperated by ":" (colons).
This csv file contains hostname and groups as follows:
HOSTNAME:VT Group
SGSGCT2AVPX001:Team1
SGSGCT2AVPX003:Team2
SGSGCT2AVPX005:Team2
PHMNCTTAVPX001:Team3
I want to... (2 Replies)
Discussion started by: dbashyam
2 Replies
5. Shell Programming and Scripting
I have made a script something like this. I want it to read the contents of either file or directory but 'cat' and 'ls' is not working. Can anyone help me? I am a newbie in scripting so dont know much about it. I also dont know how can i put my code separatly on this forum
#!/bin/bash
echo... (9 Replies)
Discussion started by: nishrestha
9 Replies
6. Programming
Hi, I'm trying to implement a C program on ubuntu which reads the contents of a file that is passed in as an argument and then displays it to the screen. So far I've cobbled together this from bits online but most of it is probably wrong as its all copied and pasted...
#include <stdio.h>... (2 Replies)
Discussion started by: cylus99
2 Replies
7. Shell Programming and Scripting
Hi,
I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file.
i am able to... (2 Replies)
Discussion started by: seeki
2 Replies
8. Shell Programming and Scripting
Hello,
I have a set of files Xfile0001 - Xfile0021, and the content of this files (one at a time) needs to be printed between some line (lines start with word "Generated") that I am extracting from another file called file7.txt and all the output goes into output.txt. First I tried creating a for... (5 Replies)
Discussion started by: jaldo0805
5 Replies
9. UNIX for Beginners Questions & Answers
Trying to use sed to insert the contents of a file into the end of each line in another file
file1
This is a line
Here is another line
This is yet another line
Here is a fourth line
file2
TEXT
desired output
This is a line TEXT
Here is another line TEXT
This is yet another... (6 Replies)
Discussion started by: jimmyf
6 Replies
10. UNIX for Beginners Questions & Answers
Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file.
While reading and merging the file contents into a single file, Like to keep the format of the source file.
... (4 Replies)
Discussion started by: Siva SQL
4 Replies
LEARN ABOUT MOJAVE
moosex::classattribute::trait::class
MooseX::ClassAttribute::Trait::Class(3) User Contributed Perl Documentation MooseX::ClassAttribute::Trait::Class(3)
NAME
MooseX::ClassAttribute::Trait::Class - A trait for classes with class attributes
VERSION
version 0.27
SYNOPSIS
for my $attr ( HasClassAttributes->meta()->get_all_class_attributes() )
{
print $attr->name();
}
DESCRIPTION
This role adds awareness of class attributes to a metaclass object. It provides a set of introspection methods that largely parallel the
existing attribute methods, except they operate on class attributes.
METHODS
Every method provided by this role has an analogous method in "Class::MOP::Class" or "Moose::Meta::Class" for regular attributes.
$meta->has_class_attribute($name)
$meta->get_class_attribute($name)
$meta->get_class_attribute_list()
These methods operate on the current metaclass only.
$meta->add_class_attribute(...)
This accepts the same options as the Moose::Meta::Attribute "add_attribute()" method. However, if an attribute is specified as "required"
an error will be thrown.
$meta->remove_class_attribute($name)
If the named class attribute exists, it is removed from the class, along with its accessor methods.
$meta->get_all_class_attributes()
This method returns a list of attribute objects for the class and all its parent classes.
$meta->find_class_attribute_by_name($name)
This method looks at the class and all its parent classes for the named class attribute.
$meta->get_class_attribute_value($name)
$meta->set_class_attribute_value($name, $value)
$meta->set_class_attribute_value($name)
$meta->clear_class_attribute_value($name)
These methods operate on the storage for class attribute values, which is attached to the metaclass object.
There's really no good reason for you to call these methods unless you're doing some deep hacking. They are named as public methods solely
because they are used by other meta roles and classes in this distribution.
BUGS
See MooseX::ClassAttribute for details.
AUTHOR
Dave Rolsky <autarch@urth.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
perl v5.18.2 2013-03-28 MooseX::ClassAttribute::Trait::Class(3)