User:Scsbot/examples/checkrhymepagepunc

From Wiktionary, the free dictionary
Jump to navigation Jump to search
#!/bin/sh 

x=`egrep -n '^== *Pronunciation *==|»'`

if echo "$x" | grep -q '[Rr]hyme.*».*[Rr]hyme.*».*[Rr]hyme.*»'
then
	echo "already has breadcrumbs"
	exit 1
elif echo "$x" | grep -q '^1:== *Pronunciation *=='
then
	exit 0
else
	echo "Pronunciation line not first"
	exit 1
fi