Date: Fri, 18 Apr 2003 14:31:17 -0400 From: Gerard Samuel <gsam@trini0.org> To: FreeBSD Questions <questions@freebsd.org> Subject: My first shell script Message-ID: <3EA04475.6060408@trini0.org>
next in thread | raw e-mail | index | archive | help
Well I had just installed mhonarc to turn a mailling list archive into
html, and didn't know how to make the
process automagic.
I never wrote a shell script from scratch before, and came up with this
after a brief search on Google for commands.
It does work, but Im just looking for critical comments to the script,
to see if I can improve on it..
If not, its in the archive for others to use it.
Thanks
------------------------------------
#!/bin/sh
#
# To populate dev team mailinglist archive
#
date=`date '+%Y-%m'`
if test ! -d /files/www/data/list_archive/$date
then
if test -s
/usr/local/ecartis/lists/dev-team/archives/mbox/dev-team.$date
then
mkdir /files/www/data/list_archive/$date
/usr/local/bin/mhonarc -outdir
/files/www/data/list_archive/$date
/usr/local/ecartis/lists/dev-team/archives/mbox/dev-team.$date
chown -R www:www /files/www/data/list_archive/$date
fi
exit
else
/usr/local/bin/mhonarc -outdir /files/www/data/list_archive/$date
-add /usr/local/ecartis/lists/dev-team/archives/mbox/dev-team.$date
chown -R www:www /files/www/data/list_archive/$date
fi
exit 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EA04475.6060408>
