I have a script which selects two 'sets' of system LVM device files from a tabular file 'mapfile' using awk :
LIVELV=`awk '{print($1)}' mapfile`
BCVLV=`awk '{print($3)}' mapfile`
I wanted to pass these 'sets' into an LVM command 'loop' along the lines of :
lvmerge $BCVLV $LIVELV
ie.... (3 Replies)
I'm a Linux newb, I've been running a Debian Linux server for about a year now, and I've written some simple scripts to automate various things, but I still don't know much, and I forget what I learn as fast as I figure it out... Anyway, that really isn't important, I just want you to know that... (14 Replies)
Hi ,
I am trying to write a script in kshell with while loop ,its like
count=1
count_cmp=1
while ; do
tail -$count tempfile | head -1 > tempstring
.......
done
However i get CIF.sh: line 33: '
I have checked thetrailing spaces , not sure what is... (4 Replies)
I'm having trouble with a simple piece of code.
IFS=,
echo "1,2,3,4,5,6,7,8" | while read x y
do
echo "x=$x"
echo "y=$y"
done
I'm hoping for
x=1
y=2
x=3
y=4
.
.
.
but I'm getting
x=1 (3 Replies)
Hi
Am trying to print the PIDs of process in a file and trying to grep any PID from that file
I set the if condition as $value != "PID" and $value != "-"
Assign that number to a variable
Am confused since am using while loop to read the line from file
and again if condition to check those... (2 Replies)
Hi,
I have two variables like below which will always be of the same size
a=1:2:3
b=A:B:C
I need to use a for/while loop that will have both the variables available. I cannot use an array here and will probably might iterate through the variable as echo $a | tr ':' '\n' and thus iterate... (5 Replies)
Hello,
I would like to ask for help with csh script.
An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that... (7 Replies)
hi,
i need a portion in a audit logging shell script where i have to loop thru multiple variables.
I need some help in accomplishing this. i have 3 variables
var1=1,23,234
var2=a,ab,xyz
var3=0,0,0
the variables will have variables number of values but same length.(3 in this case )
i... (10 Replies)
Hi!
I've run into a problem where my variables are displayed in the wrong order. Basically I'm supposed to use a file that has information like this username:firstname:lastname:etc:etc.
What I'm interested in doing is reformating it into a something more like this: username lastname,... (2 Replies)
Discussion started by: reindeermountai
2 Replies
LEARN ABOUT DEBIAN
vend::counterfile
Vend::CounterFile(3pm) User Contributed Perl Documentation Vend::CounterFile(3pm)NAME
Vend::CounterFile - Persistent counter class
SYNOPSIS
use Vend::CounterFile;
$c = new Vend::CounterFile "COUNTER", "aa00";
$id = $c->inc;
open(F, ">F$id");
DESCRIPTION
(This module is modified from Gisle Aas File::CounterFile to use
Interchange's locking protocols -- lack of fcntl locking was causing
counter problems.)
This module implements a persistent counter class. Each counter is represented by a separate file in the file system. File locking is
applied, so multiple processes might try to access the same counters at the same time without risk of counter destruction.
You give the file name as the first parameter to the object constructor ("new"). The file is created if it does not exist.
If the file name does not start with "/" or ".", then it is interpreted as a file relative to $Vend::CounterFile::DEFAULT_DIR. The default
value for this variable is initialized from the environment variable "TMPDIR", or /usr/tmp is no environment variable is defined. You may
want to assign a different value to this variable before creating counters.
If you pass a second parameter to the constructor, that sets the initial value for a new counter. This parameter only takes effect when
the file is created (i.e. it does not exist before the call).
When you call the "inc()" method, you increment the counter value by one. When you call "dec()" the counter value is decrementd. In both
cases the new value is returned. The "dec()" method only works for numerical counters (digits only).
You can peek at the value of the counter (without incrementing it) by using the "value()" method.
The counter can be locked and unlocked with the "lock()" and "unlock()" methods. Incrementing and value retrieval is faster when the
counter is locked, because we do not have to update the counter file all the time. You can query whether the counter is locked with the
"locked()" method.
There is also an operator overloading interface to the Vend::CounterFile object. This means that you might use the "++" operator for
incrementing the counter, "--" operator for decrementing and you can interpolate counters diretly into strings.
BUGS
(This problem alleviated by this modified module)
It uses flock(2) to lock the counter file. This does not work on all systems. Perhaps we should use the File::Lock module?
COPYRIGHT
Copyright (c) 1995-1998 Gisle Aas. All rights reserved. Modifications made by and copyright (C) 2002 Red Hat, Inc. and (c) 2002-2007
Interchange Development Group
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Gisle Aas <aas@sn.no>
perl v5.14.2 2010-03-25 Vend::CounterFile(3pm)