aboutsummaryrefslogtreecommitdiff
path: root/home/john/.config/rox.sourceforge.net/SendTo/.group/diff
blob: d29602ecbc81f477e1c0b1c10a3177c79ab5d352 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

d="$(dirname "$1")/"
cd "$d"

# Re-arrange x, x.orig to x.orig, x
i=0
while [ $((++i)) -le $# ]; do
	if [ $i -le $# ]; then
		if [ x"$1" = x"${2%.orig}" ]; then
			a=$1
			b=$2
			shift 2
			: $((++i))
			set -- "$@" "$b" "$a"
		else
			a=$1
			shift
			set -- "$@" "$a"
		fi
	else
		a=$1
		shift
		set -- "$@" "$a"
	fi
done

t=diff; for x in "$@"; do t=$t" ${x#$d}"; done
exec xterm -title "$t" -e with-pager diff -u "$@"