projecteq-projecteqquests/convert
2017-08-23 20:36:37 -05:00

16 lines
277 B
Bash
Executable file

#!/bin/sh
for f in */[0-9]*.pl
do
N=`cat $f | grep '#END' | cut -d- -f3 | tr -d '[ \t\n\r]'`
if [ -z "$N" ]; then
echo "$f had no standard name in it"
continue;
fi
D=`dirname "$f"`
if [ ! -r "$D/$N.pl" ]; then
echo "$f -> $D/${N}.pl"
mv $f "$D/${N}.pl"
fi
done