Sponsored Content
Top Forums Shell Programming and Scripting Copy file and evaluate its internal variables Post 302763825 by steadyonabix on Wednesday 30th of January 2013 01:21:11 PM
Old 01-30-2013
doh!

of course.

thanks Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to evaluate the value read from a file?

Hi, Could someone please help me with how to do the following? Say I have a flat file test.lst and the content of the file is: Report Date - `date '+%m%d%Y'` I'm trying the following while read myLine do echo ${myLine} done<test.lst This prints Report Date - `date... (1 Reply)
Discussion started by: arunsoman80
1 Replies

2. UNIX for Advanced & Expert Users

Forwarding internal internet packets to internal webserver using iptables

Hi, I need to redirect internal internet requests to a auth client site siting on the gateway. Currently users that are authenticated to access the internet have there mac address listed in the FORWARD chain. All other users need to be redirected to a internal site for authentication. Can... (1 Reply)
Discussion started by: mshindo
1 Replies

3. UNIX for Dummies Questions & Answers

copy file using a variables

i am having a file name hello.txt i want to move it to some where in the destination folder suppose name is accnt i have done this things but not working , can't we assign a path to a variable #/bin/sh file =hello.txt dest ='accnt' cp $file $dest Thank & Regard Dina (3 Replies)
Discussion started by: Manabhanjan
3 Replies

4. Shell Programming and Scripting

File splitting, naming file according to internal field

Hi All, I have a rather stange set of requirements that I'm hoping someone here could help me with. We receive a file that is actually a concatenation of 4 files (don't believe this would change, but ideally the solution would handle n files). The super-file looks like:... (7 Replies)
Discussion started by: Leedor
7 Replies

5. UNIX for Dummies Questions & Answers

How to use sed to copy specific lines from a file using shell variables?

hello! I am trying to use sed to copy specific set of lines from a file for which the starting and ending line numbers of the lines to be copied are stored in shell variables. How can i copy those lines? if the input_file is something like this and if the following is the script a=2 b=4... (4 Replies)
Discussion started by: a_ba
4 Replies

6. Shell Programming and Scripting

Need help in writing a script that do internal grep on a log file..and extract acct no's from it..

I need to write a script, which takes the input a log file and create output file with acct no's line by line from selected records with text like (in red) : 18:51:18 | 217863|Acct 0110855565|RC 17608| 16 Subs| 1596 UsgRecs| 2 Secs| 430 CPUms| prmis2:26213 <MoveUsage d aemon needs to run... (7 Replies)
Discussion started by: rkrish
7 Replies

7. Shell Programming and Scripting

Copy file to SD card from internal flash.

Hi, At first I have to say that I know nothing about Linux :( But I am looking for solution how to copy one file from internal Lowrnace HDS flash memory. Lowrance HDS is Linux based device. Here is the link for firmware update files for this unit. At the end of main firmware file there... (62 Replies)
Discussion started by: PouchX
62 Replies

8. UNIX for Dummies Questions & Answers

Read a flat file, evaluate and create output. UNIX SCRIPT.

Hi all, I have a flat file as below; 470423495|1||TSA-A000073800||1|||1 471423495|1||TSA-A000073800||5|||5 472423495|1||TSA-A000073800||2|||7 473423495|1||TSA-A000073800||3|||3 I like to create a Unix script. The script have to valuate the last two columns, if the values are... (4 Replies)
Discussion started by: mrreds
4 Replies

9. Shell Programming and Scripting

How to evaluate expressions in file

I have a situation where i need to evaluate expression and do substitutions in file file.ports port1=`expr $STARTINGPORT + 1` port2=`expr $STARTINGPORT + 2` port3=`expr $STARTINGPORT + 3` Intended output If my STARINGPORT is 100 port1=101 port2=102 port3=103 Can anyone please... (1 Reply)
Discussion started by: sasiharitha
1 Replies

10. UNIX for Dummies Questions & Answers

Copy same file with different variables

Hi All, I have same file with like 1xyz_1 ,1xyz_2 , 2ghj_1, 2ghj_2, 4wer_1, 4wer1_2 etc with lots of file having similar type of name. I want to creat folder and copy similar file to that folder. for example folder 1xyz should contain only 1xyz_1 ,1xyz_2. :mad: Thank you in Advance. ... (7 Replies)
Discussion started by: XXLMMN
7 Replies
Class::Gomor::Hash(3pm) 				User Contributed Perl Documentation				   Class::Gomor::Hash(3pm)

NAME
Class::Gomor::Hash - class and object builder, hash version SYNPOSIS
# Create a base class in BaseClass.pm package My::BaseClass; require Class::Gomor::Hash; our @ISA = qw(Class::Gomor::Hash); our @AS = qw(attribute1 attribute2); our @AA = qw(attribute3 attribute4); our @AO = qw(other); # You should initialize yourself array attributes sub new { shift->SUPER::new(attribute3 => [], attribute4 => [], @_) } # Create accessors My::BaseClass->cgBuildAccessorsScalar(@AS); My::BaseClass->cgBuildAccessorsArray(@AA); sub other { my $self = shift; @_ ? $self->{'other'} = [ split(/ /, shift) ] : @{$self->{'other'}}; } 1; # Create a subclass in SubClass.pm package My::SubClass; require My::BaseClass; our @ISA = qw(My::BaseClass); our @AS = qw(subclassAttribute); My::SubClass->cgBuildAccessorsScalar(@AS); sub new { shift->SUPER::new( attribute1 => 'val1', attribute2 => 'val2', attribute3 => [ 'val3', ], attribute4 => [ 'val4', ], other => [ 'none', ], subclassAttribute => 'subVal', ); } 1; # A program using those classes my $new = My::SubClass->new; my $val1 = $new->attribute1; my @values3 = $new->attribute3; my @otherOld = $new->other; $new->other("str1 str2 str3"); my @otherNew = $new->other; print "@otherNew "; $new->attribute2('newValue'); $new->attribute4([ 'newVal1', 'newVal2', ]); DESCRIPTION
This class is a subclass from Class::Gomor. It implements objects as hash references, and inherits methods from Class::Gomor. GLOBAL VARIABLE
See Class::Gomor. METHODS
new (hash) Object constructor. This is where user passed attributes (hash argument) are checked against valid attributes (gathered by cgGetAttributes method). Valid attributes are those that exists (doh!), and have not an undef value. The default is to check this, you can avoid it by setting $NoCheck global variable (see perldoc Class::Gomor). cgBuildIndices This method does nothing. It only exists to make it more easy to switch between Class::Gomor::Array and Class::Gomor::Hash. cgBuildAccessorsScalar (array ref) cgBuildAccessorsArray (array ref) See Class::Gomor. cgGetIndice (scalar) This method does nearly nothing. It only returns the passed-in scalar parameter (so the syntax is the same as in Class::Gomor::Array). It only exists to make it more easy to switch between Class::Gomor::Array and Class::Gomor::Hash. cgClone [ (scalar) ] You can clone one of your objects by calling this method. An optional parameter may be used to create multiple clones. Cloning will occure only on the first level attributes, that is, if you have attributes containing other objects, they will not be cloned. cgFullClone [ (scalar) ] This method is the same as cgClone, but will clone all attributes recursively, but only if they are subclassed from Class::Gomor. So, objects created with other modules than Class::Gomor::Array or Class::Gomor::Hash will not be cloned. Another thing to note, there is no catch for cycling references (when you link two objects with each others). You have been warned. cgDumper Will return a string as with Data::Dumper Dumper method. This is less useful for hashref objects, because they already include attributes names. SEE ALSO
Class::Gomor AUTHOR
Patrice <GomoR> Auffret COPYRIGHT AND LICENSE
Copyright (c) 2004-2009, Patrice <GomoR> Auffret You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. perl v5.10.1 2009-05-23 Class::Gomor::Hash(3pm)
All times are GMT -4. The time now is 01:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy