[TYPO3-dev] How do I compare multiple files using diff?
Martin Kutschker
martin.kutschker-no at spam-blackbox.net
Tue Jun 3 09:44:03 CEST 2008
Christopher schrieb:
> "Martin Kutschker" <martin.kutschker-no at spam-blackbox.net> schrieb im
> Newsbeitrag
> news:mailman.1.1212411125.11305.typo3-dev at lists.netfielders.de...
>> Christopher schrieb:
>>> Hi guys,
>>>
>>> at the moment I am using the following line to compare differences
>>> between 2 files:
>>>
>>> <?php
>>> exec("diff -u $oldFile_1 $newFile_1 > $output_1");
>>> ?>
>>> (I don't have shell-access available.)
>>>
>>> Now I want to compare twice two files or three times two files (not whole
>>> folders!) AND want the result in just ONE otput file.
>>> How do I achieve this?
>> You could do something like this exec("diff -u $oldFile_1 $newFile_1 >
>> $output; diff -u $oldFile_2 $newFile_2 >> $output");
>
> Hey, thanks for the hint.
> How about a for-each-loop?
No problem as long as you use >> to append to the file.
Masi
More information about the TYPO3-dev
mailing list