Touch.X
上传用户:dgyhgb
上传日期:2007-01-07
资源大小:676k
文件大小:1k
- #!/bin/sh
- ##
- ## Touch: touch or check out file form RCS
- ##
- ## This file is a part of GNU SQL Server
- ##
- ## Copyright (c) 1996, Free Software Foundation, Inc
- ## Developed at Institute of System Programming of Russian Academy of Science
- ## This file is written by Michael Kimelman
- ##
- ## This program is free software; you can redistribute it and/or modify it under
- ## the terms of the GNU General Public License as published by the Free
- ## Software Foundation; either version 2 of the License, or (at your option)
- ## any later version.
- ##
- ## This program is distributed in the hope that it will be useful, but WITHOUT
- ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- ## more details.
- ##
- ## You should have received a copy of the GNU General Public License along with
- ## this program; if not, write to the Free Software Foundation, Inc.,
- ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- ##
- ## Contacts: gss@ispras.ru
- ##
- set -x
- if [ -f $1 -a ( -w $1 -o -O $1 ) ]; then
- if [ ! -w $1 ]; then
- chmod u+w $1
- touch $1
- chmod a-w $1
- else
- touch $1
- fi
- else
- if [ -f RCS/$1,v ]; then
- if [ -f $1 ]; then
- rcsclean $2 $1
- fi
- if [ -f $1 ]; then
- echo "!!!! File $1 is modified but hasn't been saved"
- cp $1 $1____
- rm -f $1
- mv $1____ $1
- chmod ug+w $1
- touch $1
- else
- co $2 $1
- fi
- else
- if [ -f $1 ]; then
- echo "File $1 protected from writing and TOUCHing"
- fi
- fi
- fi