Hello all:
I'm new in Unix and here and I'am spanish so my english isn't so good to explain my doubt. Here it is.
Very urgent:
I need to compare the value of a variable with a string.
Example is this.
Imagine that the variable x1 contains the path and a file text and I need to compare... (2 Replies)
hi everyone -
i have a bash script that does, in broad terms, the following:
given a file containing a list of email accounts, for every account, do , then move on to the next account. pretty simple, and all that stuff works fine.
thing is, there's a very good change that any account... (2 Replies)
dear all
i had two variable in my script.
var1 and var2
var1= 10 ( it will part of date op ) Fri Aug 8 10:05:09 IST 2008
var2=9 ( it will op of ls -ltr and time part of it.)
now i want to compare of them and want to do some task if both are are not same.
kindly let me know possible... (0 Replies)
i have an array call ignore. it is set up
ignore=34th56
ignore=re45ty
ignore=rt45yu
.
.
ignore=rthg34
n is a variable. I have another variable that i read from a different file. It is $2 and it is working the way i expect. array ignore read and print correct values.
in the below if... (2 Replies)
Hello,
I am working with KSH on AIX and I have 2 files generated from different sources... as seen below:
FILE1 FILE2
AAA AAA@ABS0001C
BBB BBB@ABS0003D
CCC CCC@ABS0023A
DDD DDD@ABC0145D
EEE EEE@ABS0090A
FFF FFF@ABS0002A
GGG GGG@ABC0150D
HHH
FILE1 is main main data source,... (4 Replies)
Hello All,
I am running the below code in my script. I want if jk is empty nothing should be appened to the file total_usage.
but apparently its not happening.Kindy let me know how to do it.
###################################
jk=`ps auxf |grep -w $inputline|tr -s " "|cut -d... (0 Replies)
Hi
Could anyone please help with Awk.
The below code prints the PID of the matching process with condition with $8 and $9
ps -ef |awk '($8~/proc/) && ($9~/rPROC2/) {print $2}'
Now i want to change the Constant PROC2 from Shell variable
PROC2 is already declared in shell variable SRVNAME... (9 Replies)
Please help me with this:
I need to compare two values in if condition in shell script but its goes always to else condition:
TIME_CHECK=PM
TIME-CLOCK=PM
if ; then
echo "You have access!"
else
echo "ACCESS DENIED!"
fi (5 Replies)
How to check if pattern is matching in variable or not.
I want to check file name in variable with the pattern.
Eg: file_name="AB1000.csv"
Check for below patterns
pattern1 = AB???
pattern2 = abc??*
if file_name == <patten1>
then
...
elif file_name == <pattern2>
---... (4 Replies)
Discussion started by: vegasluxor
4 Replies
LEARN ABOUT MOJAVE
algorithm::diffold5.18
Algorithm::DiffOld(3) User Contributed Perl Documentation Algorithm::DiffOld(3)NAME
Algorithm::DiffOld - Compute `intelligent' differences between two files / lists but use the old (<=0.59) interface.
NOTE
This has been provided as part of the Algorithm::Diff package by Ned Konz. This particular module is ONLY for people who HAVE to have the
old interface, which uses a comparison function rather than a key generating function.
Because each of the lines in one array have to be compared with each of the lines in the other array, this does M*N comparisions. This can
be very slow. I clocked it at taking 18 times as long as the stock version of Algorithm::Diff for a 4000-line file. It will get worse
quadratically as array sizes increase.
SYNOPSIS
use Algorithm::DiffOld qw(diff LCS traverse_sequences);
@lcs = LCS( @seq1, @seq2, $comparison_function );
$lcsref = LCS( @seq1, @seq2, $comparison_function );
@diffs = diff( @seq1, @seq2, $comparison_function );
traverse_sequences( @seq1, @seq2,
{ MATCH => $callback,
DISCARD_A => $callback,
DISCARD_B => $callback,
},
$comparison_function );
COMPARISON FUNCTIONS
Each of the main routines should be passed a comparison function. If you aren't passing one in, use Algorithm::Diff instead.
These functions should return a true value when two items should compare as equal.
For instance,
@lcs = LCS( @seq1, @seq2, sub { my ($a, $b) = @_; $a eq $b } );
but if that is all you're doing with your comparison function, just use Algorithm::Diff and let it do this (this is its default).
Or:
sub someFunkyComparisonFunction
{
my ($a, $b) = @_;
$a =~ m{$b};
}
@diffs = diff( @lines, @patterns, &someFunkyComparisonFunction );
which would allow you to diff an array @lines which consists of text lines with an array @patterns which consists of regular expressions.
This is actually the reason I wrote this version -- there is no way to do this with a key generation function as in the stock
Algorithm::Diff.
perl v5.18.2 2006-07-30 Algorithm::DiffOld(3)