[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script the Patch !



This is the gendiff script from Fedora systems.  Does exactly
what you want:

#!/bin/sh

[ -z "$1" -o -z "$2" ] && {
# usage
  echo "usage: $0 <directory> <diff-extension>" 1>&2
  exit 1
}

find $1 \( -name "*$2" -o -name ".*$2" \) -print |
while read f; do
    U=-u
    [ "`basename $f`" = "ChangeLog$2" ] && U=-U0
#    diff ${U} $f `echo $f | sed s/$2\$//`
    if [ -r "$f" ]; then
        diff ${U} "${f}" "${f%$2}"
    else
        diff ${U} /dev/null "${f%$2}"
    fi
done




b


On Sat, 15 May 2004, ahmad khalifa wrote:

>
>
> I need help automating the 'diff' process.
> everytime i create the patch i keep 'diff'ing about
> 9 files, so i need some script that can just call a
> few shell commands
> example:
> diff -u cups/file.orig cups/file >> patch
> ... [8 more times]
>
> no need for anything more, just a script and i'll edit
> the file names in the script.
>
> i understand this can be done by a bash script, can anyone
> help ??
>
>
> ak.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> _______________________________________________
> Developer mailing list
> Developer at arabeyes dot org
> http://lists.arabeyes.org/mailman/listinfo/developer
>
>

--behdad
  behdad.org