root/bin/reverse_join @ 6732
1 |
#!/bin/sh
|
---|---|
2 |
# Inner-joins two map spreadsheets in the opposite order they are specified in
|
3 |
|
4 |
selfDir="$(dirname -- "$0")" |
5 |
|
6 |
if ! test "$#" -eq 1; then |
7 |
echo "Usage: $0 <map_1 map_0 >joined_map"|fold -s >&2 |
8 |
exit 2
|
9 |
fi
|
10 |
|
11 |
temp="$(tempfile)" |
12 |
trap "rm -f $temp" EXIT |
13 |
|
14 |
cat >"$temp" # read stdin into file |
15 |
"$selfDir/join" <"$1" "$temp" |