Show More
@@ -41,6 +41,9 b' filediff(){' | |||||
41 | diff -u "$file1" "$file2" | |
|
41 | diff -u "$file1" "$file2" | | |
42 | sed "s@^--- /dev/null\(.*\)\$@--- $1\1@" | |
|
42 | sed "s@^--- /dev/null\(.*\)\$@--- $1\1@" | | |
43 | sed "s@^\+\+\+ /dev/null\(.*\)\$@+++ $2\1@" |
|
43 | sed "s@^\+\+\+ /dev/null\(.*\)\$@+++ $2\1@" | |
|
44 | ||||
|
45 | # in this case, files differ from each other | |||
|
46 | return 1 | |||
44 | } |
|
47 | } | |
45 |
|
48 | |||
46 | if test -d "$1" -o -d "$2"; then |
|
49 | if test -d "$1" -o -d "$2"; then | |
@@ -53,6 +56,14 b' if test -d "$1" -o -d "$2"; then' | |||||
53 | while read file; do |
|
56 | while read file; do | |
54 | filediff "$1/$file" "$2/$file" "diff -Nru $1/$file $2/$file" |
|
57 | filediff "$1/$file" "$2/$file" "diff -Nru $1/$file $2/$file" | |
55 | done |
|
58 | done | |
|
59 | ||||
|
60 | # TODO: there is no portable way for current while-read based | |||
|
61 | # implementation to return 1 at detecting changes. | |||
|
62 | # | |||
|
63 | # On bash and dash, assignment to variable inside while-block | |||
|
64 | # doesn't affect outside, because inside while-block is executed | |||
|
65 | # in sub-shell. BTW, it affects outside while-block on ksh (as sh | |||
|
66 | # on Solaris). | |||
56 | else |
|
67 | else | |
57 | filediff "$1" "$2" |
|
68 | filediff "$1" "$2" | |
58 | fi |
|
69 | fi |
General Comments 0
You need to be logged in to leave comments.
Login now