summaryrefslogtreecommitdiff
path: root/dviware/umddvi/misc/makesubdir.sh
blob: dd7d74e053348d8b1c2823d6bfd82d381eea81f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/sh
#
# makesubdir - make the TeX fonts reside in a subdirectory style system
#
# usage:
#	cd /usr/lib/tex/fonts
#	sh makesubdir.sh

if [ -f SUBDIR ]; then
	echo "$0: SUBDIR file already exists.
Are you sure you need to do this?
(If so, remove the SUBDIR file and try again.)" 1>&2
	exit 1
fi

>SUBDIR

for font in *.*pxl; do
	dir=`echo $font | sed -e 's/\..*//'`
	if [ ! -d $dir ]; then
		if [ -f $dir ]; then
echo "$0: \`$dir' exists as a file (renamed to $dir.old)" 1>&2
			if mv -i $dir $dir.old; then
				echo "$0: aborting" 1>&2
			fi
		fi
		mkdir $dir
	fi
	mv -i $font $dir/$font
done