• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# checkXrefs - check internal links in a Vulkan HTML spec
3# Usage: checkXrefs file.html
4# Prints a list of internal hrefs with no corresponding anchors.
5# (There are many anchors with no corresponding hrefs - this is OK).
6
7xrefs=`tempfile`
8ids=`tempfile`
9
10sed -e 's/ href="#/\nhref="#/g' < $1 | \
11    grep 'href="#' | \
12    sed -e 's/href="#//g' -e 's/"[ >].*//g' | \
13    sort | uniq > $xrefs
14sed -e 's/ id="/\nid="/g' < $1 | \
15    grep 'id="' | \
16    sed -e 's/id="//g' -e 's/"[ >].*//g' | \
17    sort | uniq > $ids
18
19comm -23 $xrefs $ids
20
21rm $xrefs $ids 1>&2
22