diff options
author | KatolaZ <katolaz@freaknet.org> | 2018-07-19 17:11:30 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2018-07-19 17:11:30 +0100 |
commit | 7671fe70a355ceb7620585475da7d0dc646a3048 (patch) | |
tree | 3d0ef278723de5701912fcb877433f3e5a7328d2 |
first commit -- goval
-rwxr-xr-x | goval | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +#!/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 |