mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 05:09:43 +00:00
Add rundiff script for testing radiff2 -u features
This commit is contained in:
parent
1e5a4f05ff
commit
1a81e775d8
36
sys/rundiff
Executable file
36
sys/rundiff
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
show_help() {
|
||||
echo "Usage: rundiff [-u] [cmd] [file1] [file2]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
UNIQ=0
|
||||
if [ "$1" = "-u" ]; then
|
||||
UNIQ=1
|
||||
shift
|
||||
fi
|
||||
|
||||
cmd=""
|
||||
arg=""
|
||||
for a in $@ ; do
|
||||
if [ -n "$B" ]; then
|
||||
cmd="$cmd $B"
|
||||
fi
|
||||
B="$A"
|
||||
A="$a"
|
||||
done
|
||||
if [ -z "$cmd" -o -z "$A" -o -z "$B" ]; then
|
||||
show_help
|
||||
fi
|
||||
|
||||
if [ "$UNIQ" = 1 ]; then
|
||||
eval $cmd $A | sort -u > .a
|
||||
eval $cmd $B | sort -u > .b
|
||||
else
|
||||
eval $cmd $A > .a
|
||||
eval $cmd $B > .b
|
||||
fi
|
||||
echo $cmd $A
|
||||
echo $cmd $B
|
||||
diff -ru .a .b
|
||||
rm -f .a .b
|
Loading…
Reference in New Issue
Block a user