--- /dev/null
+#!/bin/bash
+
+# $Id$
+# $URL$
+
+for p in ci rcs rcsdiff stat chmod ; do
+ type -p ${p} >/dev/null
+ if [ "$?" != "0" ] ; then
+ echo "Command '${p}' not found." >&2
+ exit 6
+ fi
+done
+
+for FILE in "$@"; do
+
+ echo
+
+ if [ ! -e "${FILE}" ] ; then
+ echo "File '${FILE}' doesn't exists." >&2
+ continue
+ fi
+
+ if [ ! -f "${FILE}" ] ; then
+ echo "File '${FILE}' isn't a normal file." >&2
+ continue
+ fi
+
+ case "${FILE}" in
+ *,v)
+ echo "File '${FILE}' is a RCS repository." >&2
+ continue
+ ;;
+ esac
+
+ MSG="Initial"
+ if [ -f "${FILE},v" ] ; then
+ MSG="Checked in."
+ rcsdiff -q "${FILE}" >/dev/null
+ RES="$?"
+ if [ "${RES}" = "0" ] ; then
+ echo "File '${FILE}' wasn't changed." >&2
+ continue
+ fi
+ fi
+
+ echo "Checking in '${FILE}' ..."
+ PERM=`stat -c "%a" "${FILE}"`
+ echo " rcs -q -l \"${FILE}\""
+ rcs -q -l "${FILE}" >/dev/null
+ echo " echo \"${MSG}\" | ci -l -d \"${FILE}\""
+ echo "${MSG}" | ci -u -d "${FILE}"
+ echo " rcs -q -u \"${FILE}\""
+ rcs -q -u "${FILE}" >/dev/null
+ echo " chmod ${PERM} \"${FILE}\""
+ chmod "${PERM}" "${FILE}"
+
+done
+
+# vim: ts=4 syntax=sh