1 #!/bin/sh 2 3 MAPPINGS=$* 4 ID_MAPPING="mapping-id-to-page.txt" 5 TINY_ID_MAPPING="mapping-tiny-to-id.txt" 6 TINY_MAPPING="mapping-tiny-to-page.txt" 7 TAB=`printf '\t'` 8 9 # Combine the space mappings into a common mapping from page identifiers to 10 # page names. 11 sort -n -u $MAPPINGS > "$ID_MAPPING" 12 13 # Produce a common mapping from tiny URL identifiers to page names. 14 cut -f 1 "$ID_MAPPING" | uniq | python tiny.py - > "$TINY_ID_MAPPING" 15 join -t "$TAB" -1 2 -2 1 "$TINY_ID_MAPPING" "$ID_MAPPING" | cut -f 2,3 | LC_ALL=C sort > "$TINY_MAPPING"