From 7671fe70a355ceb7620585475da7d0dc646a3048 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Thu, 19 Jul 2018 17:11:30 +0100 Subject: first commit -- goval --- goval | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 goval (limited to 'goval') diff --git a/goval b/goval new file mode 100755 index 0000000..6c598c6 --- /dev/null +++ b/goval @@ -0,0 +1,14 @@ +#!/bin/sh + +## +## validate a gophermap -- just pipe in the file +## +## (c) 2018 Vincenzo 'KatolaZ' Nicosia +## + +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 -- cgit v1.2.3