Sponsored Content
Full Discussion: Where is my mystake?
Top Forums Shell Programming and Scripting Where is my mystake? Post 29533 by Yaki on Tuesday 8th of October 2002 10:43:13 AM
Old 10-08-2002
Power Where is my mystake?

#!/bin/bash
while [true]
do
who > .f
who > .s
diff .f .s > .t
if [ -s .t ]
then
echo "In System Stranger"
break
else
continue
fi
done




It doesn't work,when I connect to localhost with SSH
and It doesn't do echo "In System stranger"

Smilie Smilie

Last edited by Yaki; 10-08-2002 at 11:49 AM..
 
XDIFF_STRING_PATCH(3)							 1						     XDIFF_STRING_PATCH(3)

xdiff_string_patch - Patch a string with an unified diff

SYNOPSIS
string xdiff_string_patch (string $str, string $patch, [int $flags], [string &$error]) DESCRIPTION
Patches a $str string with an unified patch in $patch parameter and returns the result. $patch has to be an unified diff created by xdiff_file_diff(3)/xdiff_string_diff(3) function. An optional $flags parameter specifies mode of operation. Any rejected parts of the patch will be stored inside $error variable if it is provided. PARAMETERS
o $str - The original string. o $patch - The unified patch string. It has to be created using xdiff_string_diff(3), xdiff_file_diff(3) functions or compatible tools. o $flags -$flags can be either XDIFF_PATCH_NORMAL (default mode, normal patch) or XDIFF_PATCH_REVERSE (reversed patch). Starting from ver- sion 1.5.0, you can also use binary OR to enable XDIFF_PATCH_IGNORESPACE flag. o $error - If provided then rejected parts are stored inside this variable. RETURN VALUES
Returns the patched string, or FALSE on error. EXAMPLES
Example #1 xdiff_string_patch(3) example The following code applies changes to some article. <?php $old_article = file_get_contents('./old_article.txt'); $diff = $_SERVER['patch']; /* Let's say that someone pasted a patch to html form */ $errors = ''; $new_article = xdiff_string_patch($old_article, $diff, XDIFF_PATCH_NORMAL, $errors); if (is_string($new_article)) { echo "New article: "; echo $new_article; } if (strlen($errors)) { echo "Rejects: "; echo $errors; } ?> SEE ALSO
xdiff_string_diff(3). PHP Documentation Group XDIFF_STRING_PATCH(3)
All times are GMT -4. The time now is 11:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy