Sponsored Content
Top Forums Shell Programming and Scripting populate variable from remote result Post 302107535 by hcclnoodles on Monday 19th of February 2007 04:44:46 AM
Old 02-19-2007
doh !! thankyou
 

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

How to get a result of a cmd into variable?

Hi , I am trying following . I need to get a result of an autosys cmd into a unix variable. The autosys cmd is autostatus -G jpm_day_today Please help me in storing the value returned by this cmd into a unix variable. Appreciate your time to read this post. (1 Reply)
Discussion started by: manchau
1 Replies

2. Shell Programming and Scripting

running command remotely to populate local variable

If I run this # ssh remote-server 'du -sk /usr/platform/`uname -i`/' 174 /usr/platform/SUNW,Sun-Fire-V245 I get my output just fine, However, if i try to do the same but populate a local variable within my script called for example 'result' #!/bin/ksh result=`ssh remote-server... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

3. Shell Programming and Scripting

Assign result to variable

Hi friends, firstly, i can run following expression and i took 100 value. sqlplus -s username/password@TTTEST @umt.sql umt.sql exists "select t.deger from parametre t where t.id=30". result of this query =100 i need to assign this value(100) to variable(for example x... (2 Replies)
Discussion started by: temhem
2 Replies

4. Shell Programming and Scripting

PHP populate variable with function

Hi, I've a php scirpt that calls in an external class. The external class, myClass, has several public and private functions. There is one public function which derives a value that I want be able to bring it to the main php scirpt. Here is the code. ....snip.... include... (1 Reply)
Discussion started by: nitin
1 Replies

5. Shell Programming and Scripting

populate a bash variable from an awk operation

Hi, I'm trying to populate bash script variable, data_size with the size of the largest file in my current directory data_size=$(ls -lS | grep -v "total" | head -1) | awk '{ print $5 }' I've tried adding an echo before the call to awk data_size=$(ls -l | grep -v "total" | head -1) |... (2 Replies)
Discussion started by: mark_s_g
2 Replies

6. Shell Programming and Scripting

result in variable

Hi all, I'll try to get a result from a search with "awk" into a variable. It works for those examples: findfirstline=`awk 'BEGIN{ mycount = 1 } { if(mycount == 1 && /^Video/){ row=NR; print row; mycount = 0; }}' ${i}` findlastline=`awk '/^Video/ {row=NR} END{print row}' ${i}` But it... (6 Replies)
Discussion started by: tempestas
6 Replies

7. Shell Programming and Scripting

How to combine two variable result?

Hi, i have two variables i.e lck_ckm_customer=ckm_customer and(present in some script A) table=ckm_customer(present in script B) in script B i am executing this part if ; then --- ---- ---- fi Now, while comparing in my log file i am getting this result if but i... (2 Replies)
Discussion started by: gnnsprapa
2 Replies

8. Shell Programming and Scripting

Result of 'cut' into variable

Hello, I would like to have a result of a cut-command in a variable. The file "t.dat" has the following content: Company 001.239879123.OB1X.672W12.STS UNOLD.001.02 My bash-script: Header="" Header=$(cut -c1-160 t.dat | head -1) echo $Header ... (9 Replies)
Discussion started by: API
9 Replies

9. Shell Programming and Scripting

How to store remote variable from remote cat file ??

I am trying to cat on a file located on remote server and assign it to remote variable. I have both local and remote variables. Running below script from local. test.sh J_NAME=XXX2 J_IP=XXX ssh $J_IP "ps auxw |grep java | grep -v grep |grep $J_NAME | awk '{print ... (2 Replies)
Discussion started by: oraclermanpt
2 Replies

10. Shell Programming and Scripting

Store result variable

Friends have the following problem: cat $PATH_DAT/mr.txt | nawk 'BEGIN { CantPnt=0; NumReg=0; FS="|" } { NumReg++ CantPnt=CantPnt+int($2) } END{ printf... (5 Replies)
Discussion started by: tricampeon81
5 Replies
Class::Gomor::Array(3pm)				User Contributed Perl Documentation				  Class::Gomor::Array(3pm)

NAME
Class::Gomor::Array - class and object builder, array version SYNPOSIS
# Create a base class in BaseClass.pm package My::BaseClass; require Class::Gomor::Array; our @ISA = qw(Class::Gomor::Array); 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 indices and accessors My::BaseClass->cgBuildIndices; My::BaseClass->cgBuildAccessorsScalar(@AS); My::BaseClass->cgBuildAccessorsArray(@AA); sub other { my $self = shift; @_ ? $self->[$self->cgGetIndice('other')] = [ split(/ /, shift) ] : @{$self->[$self->cgGetIndice('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->cgBuildIndices; 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 array references, and inherits methods from Class::Gomor. GLOBAL VARIABLES
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 You MUST call this method one time at the beginning of your classes, and all subclasses (even if you do not add new attributes). It will build the matching between object attributes and their indices inside the array object. Global variables will be created in your class, with the following format: $__attributeName. cgBuildAccessorsScalar (array ref) cgBuildAccessorsArray (array ref) See Class::Gomor. cgGetIndice (scalar) Returns the array indice of specified attribute passed as a parameter. You can use it in your programs to avoid calling directly the global variable giving indice information concerning requesting object, thus avoiding using `no strict 'vars';'. This method is usually used when you build your own accessors (those using attributes defined in @AO). 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 useful for debugging purposes, because an arrayref object does not 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::Array(3pm)
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy