用户管理  |   用户注册                                                                                    首 页软件下载教程中心办公指南flash动画文档下载办公公文

www.4oa.com - 中科软件园

投递文章 用户管理 投稿指南 资讯通告 :
站内搜索: 您的位置中科软件园 > 教程中心 > 操作系统 > Linux > 软件使用 > 教程内容

CVS-RCS(二)

2005-5-21 17:37:55  来源:本站整理  作者:不详 【 投递文章
内容提要:-lt1];thenUsagefibkextn=sget_bakhme=`echo$HOME|cut-f1-d''`if["$hme"=""];thenprint"\nError:\$HOMEisno...
-lt 1 ]; then
Usage
fi

bkextn=sget_bak

hme=` echo $HOME | cut -f1 -d' ' `
if [ "$hme" = "" ]; then
print "\nError: \$HOME is not set!!\n"
exit
fi

# Check if file already exists....
if [ -f $1 ]; then
user_perms=" "
group_perms=" "
other_perms=" "
user_perms=`ls -l $1 | awk '{print $1 }' | cut -b3-3 `
group_perms=`ls -l $1 | awk '{print $1 }' | cut -b6-6 `
other_perms=`ls -l $1 | awk '{print $1 }' | cut -b9-9 `
if [ "$user_perms" = "w" -o "$group_perms" = "w" \
-o "$other_perms" = "w" ]; then
print "\nError: The file is writable. Aborting $cmdname ......"
print " You should either backup, scommit or delete the f
ile and"
print " try $cmdname again\n"
exit
fi
fi

cur_dir=`pwd`
#echo $cur_dir

len=${#hme}
len=$(($len + 2))
#echo $len

subdir=` echo $cur_dir | cut -b $len-2000 `
#echo $subdir

if [ "$subdir" = "" ]; then
fdname=$1
else
fdname=$subdir"/"$1
fi

# Move the file
touch $1 2>/dev/null
\mv -f $1 $1.$bkextn

# Create subshell
(
cd $hme
#echo $fdname

# Use -A option to clear all sticky flags
if [ "$FLAG1" = "" ]; then
cvs -r checkout -A $fdname
else
cvs -r checkout -A -$FLAG1 $OARG1 $fdname
fi
)
#pwd

if [ -f $1 ]; then
print "\nREAD-ONLY copy of the file $fdname obtained."
print "Done $cmdname"
#print "\nTip (Usage): $cmdname \n"
fi

上一页  [1] [2] 

(评论内容只代表网友观点,与本站立场无关!)[ 全部评论 ]

网友评论:

    用户名:

    评   分:100分 85分 70分 55分 40分 25分 10分 0分

    内 容:

                 (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码

关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 -有事点这里