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 PHP
xdiff_string_diff
XDIFF_STRING_DIFF(3) 1 XDIFF_STRING_DIFF(3)xdiff_string_diff - Make unified diff of two stringsSYNOPSIS
string xdiff_string_diff (string $old_data, string $new_data, [int $context = 3], [bool $minimal = false])
DESCRIPTION
Makes an unified diff containing differences between $old_data string and $new_data string and returns it. The resulting diff is human-
readable. An optional $context parameter specifies how many lines of context should be added around each change. Setting $minimal parameter
to true will result in outputting the shortest patch file possible (can take a long time).
PARAMETERS
o $old_data
- First string with data. It acts as "old" data.
o $new_data
- Second string with data. It acts as "new" data.
o $context
- Indicates how many lines of context you want to include in the diff result.
o $minimal
- Set this parameter to TRUE if you want to minimalize the size of the result (can take a long time).
RETURN VALUES
Returns string with resulting diff or FALSE if an internal error happened.
EXAMPLES
Example #1
xdiff_string_diff(3) example
The following code makes unified diff of two articles.
<?php
$old_article = file_get_contents('./old_article.txt');
$new_article = $_REQUEST['article']; /* Let's say that someone pasted a new article to html form */
$diff = xdiff_string_diff($old_article, $new_article, 1);
if (is_string($diff)) {
echo "Differences between two articles:
";
echo $diff;
}
?>
NOTES
Note
This function doesn't work well with binary strings. To make diff of binary strings use xdiff_string_bdiff(3)/xdiff_string_rabd-
iff(3).
SEE ALSO xdiff_string_patch(3).
PHP Documentation Group XDIFF_STRING_DIFF(3)