diff --git a/snazzer b/snazzer index c59cfa5..ee3283d 100755 --- a/snazzer +++ b/snazzer @@ -76,10 +76,10 @@ glob2grep_file() { FILE=$1 OUT=$(mktemp) - # check if every line starts with either / or *, if not it's a syntax error. + # check if every line starts with either / or *, if not, quit with a syntax error. while read -r line; do - if ! [[ "$line" =~ ^[/\*].* ]]; then - echo "SYNTAX ERROR: $1 contains lines that start with neither / nor *." >&2 + if ! echo "$line" | grep '^[/*]' >/dev/null; then + echo "SYNTAX ERROR: $1 contains line $line that start with neither / nor *." >&2 exit 12 fi done < "$1" diff --git a/snazzer-measure b/snazzer-measure index 9dc0691..e88223d 100755 --- a/snazzer-measure +++ b/snazzer-measure @@ -173,10 +173,10 @@ glob2grep_file() { FILE=$1 OUT=$(mktemp) - # check if every line starts with either / or *, if not it's a syntax error. + # check if every line starts with either / or *, if not, quit with a syntax error. while read -r line; do - if ! [[ "$line" =~ ^[/\*].* ]]; then - echo "SYNTAX ERROR: $1 contains lines that start with neither / nor *." >&2 + if ! echo "$line" | grep '^[/*]' >/dev/null; then + echo "SYNTAX ERROR: $1 contains line $line that start with neither / nor *." >&2 exit 12 fi done < "$1"