Sponsored Content
Full Discussion: Keeping the format ...
Top Forums Shell Programming and Scripting Keeping the format ... Post 14523 by Cameron on Friday 1st of February 2002 10:52:26 AM
Old 02-01-2002
Thanks heaps guys. Smilie
Will try to implement it when I go back to work later today.
 

9 More Discussions You Might Find Interesting

1. Solaris

keeping history of command

hi can anyone tell me how or where to set to enable history of command keyed in to be logged? so that it can be used or traced later. thanks (3 Replies)
Discussion started by: legato
3 Replies

2. AIX

Script Keeping Track of Itself

Hi All We have a WEB Based application running on the IBM AIX server. There is a EOD Job which runs a UNIX script containing EOD Jobs. Say If any job fails then we have to explicitly comment out the jobs which were successfully executed and then re run the same. Is there any was by which we... (7 Replies)
Discussion started by: Prashantckc
7 Replies

3. Red Hat

keeping systems updated

I have several RHEL systems that are on an isolated network so I can't run up2date or yum directly on them. What is the best way to keep these systems updated and patched? Thanks (4 Replies)
Discussion started by: wazzu62
4 Replies

4. Solaris

keeping a process alive ?

Hello guys, I have one script running that I need to keep it running 24x7 so I'd like to know how can I implement a sort of monitoring process I mean if for some reason this process dies somehow it gets automatically started again. Thanks. (8 Replies)
Discussion started by: cerioni
8 Replies

5. Shell Programming and Scripting

Help with file editing while keeping file format intact

Hi, I am having a file which is fix length and comma seperated. And I want to replace values for one column. I am reading file line by line in variable $LINE and then replacing the string. Problem is after changing value and writing new file temp5.txt, formating of original file is getting... (8 Replies)
Discussion started by: Mruda
8 Replies

6. Shell Programming and Scripting

Keeping last part

Hello, Sorry for the poor tilte but I still don't know how to this. Here is my problem. I have to huge log file. In this log file I can know where is stored all my files. As I have to get a reporting of of files I only need to keep the file name but I don't know how to do it. I hope you... (5 Replies)
Discussion started by: Aswex
5 Replies

7. Shell Programming and Scripting

Replace date value with another value keeping all as is

Hi forum. How do I change the following date value with another value (while keeping the rest of the line) using sed? The date values can change so I need a general sed command to change the date value within the first quotation marks only. Date values will be coming from 2 different files.... (2 Replies)
Discussion started by: pchang
2 Replies

8. Shell Programming and Scripting

Keeping the number intact

Currently I have the following to separate the numeric values. However the decimal point get separated. ls -lrt *smp*.cmd | awk '{print $NF}' | sed 's/^.*\///' | sed 's/\(*\)/ & /g' As an example on the files n02-z30-dsr65-terr0.50-dc0.05-4x3smp.cmd... (8 Replies)
Discussion started by: kristinu
8 Replies

9. UNIX for Dummies Questions & Answers

Replace some strings keeping others

I want to replace strings in test2 according to test1 table. In doing so, I`m losing records that I dont need to replace, please suggest modifications. what i have $ cat > test1 a b c d   $ cat > test2 a a a d d   what i tried $ awk ' BEGIN {FS=OFS=" "} FNR==NR{a=$2;next}... (2 Replies)
Discussion started by: senhia83
2 Replies
Heap::Elem(3pm) 					User Contributed Perl Documentation					   Heap::Elem(3pm)

NAME
Heap::Elem - Base class for elements in a Heap SYNOPSIS
use Heap::Elem::SomeInheritor; use Heap::SomeHeapClass; $elem = Heap::Elem::SomeInheritor->new( $value ); $heap = Heap::SomeHeapClass->new; $heap->add($elem); DESCRIPTION
This is an inheritable class for Heap Elements. It provides the interface documentation and some inheritable methods. Only a child classes can be used - this class is not complete. METHODS
$elem = Heap::Elem::SomeInheritor->new( [args] ); Creates a new Elem. If there is exactly one arg, the Elem's value will be set to that value. If there is more than one arg provided, the Elem's value will be set to an anonymous hash initialized to the provided args (which must have an even number, of course). $elem->heap( $val ); $elem->heap; Provides a method for use by the Heap processing routines. If a value argument is provided, it will be saved. The new saved value is always returned. If no value argument is provided, the old saved value is returned. The Heap processing routines use this method to map an element into its internal structure. This is needed to support the Heap methods that affect elements that are not are the top of the heap - decrease_key and delete. The Heap processing routines will ensure that this value is undef when this elem is removed from a heap, and is not undef after it is inserted into a heap. This means that you can check whether an element is currently contained within a heap or not. (It cannot be used to determine which heap an element is contained in, if you have multiple heaps. Keeping that information accurate would make the operation of merging two heaps into a single one take longer - it would have to traverse all of the elements in the merged heap to update them; for Binomial and Fibonacci heaps that would turn an O(1) operation into an O(n) one.) $elem->val( $val ); $elem->val; Provides a method to get and/or set the value of the element. $elem1->cmp($elem2) A routine to compare two elements. It must return a negative value if this element should go higher on the heap than $elem2, 0 if they are equal, or a positive value if this element should go lower on the heap than $elem2. Just as with sort, the Perl operators <=> and cmp cause the smaller value to be returned first; similarly you can negate the meaning to reverse the order - causing the heap to always return the largest element instead of the smallest. INHERITING
This class can be inherited to provide an object with the ability to be heaped. If the object is implemented as a hash, and if it can deal with a key of heap, leaving it unchanged for use by the heap routines, then the following implemetation will work. package myObject; require Exporter; @ISA = qw(Heap::Elem); sub new { my $self = shift; my $class = ref($self) || $self; my $self = SUPER::new($class); # set $self->{key} = $value; } sub cmp { my $self = shift; my $other = shift; $self->{key} cmp $other->{key}; } # other methods for the rest of myObject's functionality AUTHOR
John Macdonald, john@perlwolf.com COPYRIGHT
Copyright 1998-2007, O'Reilly & Associates. This code is distributed under the same copyright terms as perl itself. SEE ALSO
Heap(3), Heap::Elem::Num(3), Heap::Elem::NumRev(3), Heap::Elem::Str(3), Heap::Elem::StrRev(3). perl v5.8.8 2007-10-23 Heap::Elem(3pm)
All times are GMT -4. The time now is 08:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy