automatic header insertion

hi
Is there any way to automatically insert a predefined header into a file?
It would include the file name, author name, date and a description, the description entered on the first line of vi.

Thanks for any help

Oliver

Do you mean while you are in vi?

Hi jim
Thanks for the interest, it was when starting a new file in vi to automatically insert the header, but i worked it out.

Thanks though

Oliver

Olimiles,

Can you let me know how you acheived it?

No problem!

#!/bin/bash
AUTHOR=`grep $USER /etc/passwd | cut -d":" -f5`
DATE=`date '+%Y/%m/%d'`
read DESCRIPTION
cat << END
#!/bin/sh
####################################
## Program      : $1
## Author       : $AUTHOR
## Date         : $DATE
## Description  : $DESCRIPTION
###################################
END