freebsd-dev/sys/dev/vinum/makestatetext
Peter Wemm ef2dbe9885 If I've done this right, revive the vinum code in it's now home after it
was savaged in the blood bath a few hours ago.
1998-12-28 04:56:24 +00:00

41 lines
1010 B
Bash
Executable File

#!/bin/sh
# Make statetexts.h from vinumstate.h
# $Id: makestatetext,v 1.1.1.1 1998/09/16 05:56:21 grog Exp $
infile=vinumstate.h
ofile=statetexts.h
cat <COPYRIGHT > $ofile
echo >>$ofile "/* Created by $0 on" `date`. "Do not edit */"
echo >>$ofile
echo >>$ofile "/* Drive state texts */"
echo >>$ofile "char *drivestatetext [] =
{ "
egrep -e 'drive_[A-z0-9]*,' <$infile | grep -v = | sed 's: *drive_\([^,]*\).*: \"\1\",:' >>$ofile
cat <<FOO >> $ofile
};
/* Subdisk state texts */
char *sdstatetext [] =
{
FOO
egrep -e 'sd_[A-z0-9]*,' $infile | grep -v = | sed 's: *sd_\([^,]*\).*: \"\1\",:' >>$ofile
cat <<FOO >> $ofile
};
/* Plex state texts */
char *plexstatetext [] =
{
FOO
egrep -e 'plex_[A-z0-9]*,' $infile | grep -v = | sed 's: *plex_\([^,]*\).*: \"\1\",:' >>$ofile
cat <<FOO >> $ofile
};
/* Volume state texts */
char *volstatetext [] =
{
FOO
egrep -e 'volume_[A-z0-9]*,' $infile | grep -v = | sed 's: *volume_\([^,]*\).*: \"\1\",:' >>$ofile
cat <<FOO >> $ofile
};
FOO