various Gopher-related utils
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gopherutils/goval

14 lines
310 B

#!/bin/sh
##
## validate a gophermap -- just pipe in the file
##
## (c) 2018 Vincenzo 'KatolaZ' Nicosia <katolaz@freaknet.org>
##
FIN=${1:-/dev/stdin}
res=$(cat $FIN | sed -n -E -e '/(^[0-9+gIThis].*\t.*\t.*\t|^\.\r$)/! =' | tr '\n' ' ')
[ -z "$res" ] && exit 0
echo "Errors on lines: $res" >&2 && exit 1