#       ==============================================================
#       Copyright (c) 1996-1998 Tim Barbour.
#       Copyright (c) 1998-1999 ACT Financial Systems Pty Ltd.
#       All Rights Reserved.
#       This make library may be used and distributed under the terms
#       of the GNU LGPL, as published by the Free Software Foundation.
#       See the file COPYING for details.
#       ==============================================================
#	$Id: functions.sh,v 1.3 1999/05/17 05:58:06 akivaq Exp $	

#-------------------------------------------------------------------------------------------------------
# provides common shell functions
#//+ there seems to be a problem with the modification time getting truncated in renaming
#-------------------------------------------------------------------------------------------------------

MoveAnyOldLog() {
    if [ -f $1 ]; then
	modification_time=`ls -l $1 | perl -e 'while (<>) {                                        \
                                                  s/[rwx-]*\s+\w+\s+\w+\s+\w+\s+\d+\s+([^:]+:\d+).*/\1/; \
                                                  print "$_"; }'                                   \
                                    | tr ' ' '_'`
	mv $1 $1.$modification_time
    fi
}
