Skip to content

Instantly share code, notes, and snippets.

@vladimyr
Created March 29, 2021 02:24
Show Gist options
  • Save vladimyr/ca228d052a6e245109e4182d582913f1 to your computer and use it in GitHub Desktop.
Save vladimyr/ca228d052a6e245109e4182d582913f1 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
pushd "$HOME/.tldr/cache/pages" >/dev/null 2>&1
pages=$(rg -o 'linux.die.net/man/([^/])/([^>]+)' -r '$2.$1' | sort)
for page in $pages; do
tldrpage=$(echo $page | cut -d':' -f1)
manpage=$(echo $page | cut -d':' -f2)
url="https://man.archlinux.org/man/$manpage"
status=$(curl -sI "$url" | grep 'HTTP/')
printf '%s:\t%s\t%s\n' "$tldrpage" "$manpage" "$status"
done
popd >/dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment