CVS-RCS(6)

发表于:2007-06-21来源:作者:点击数: 标签:
4.6 slist 注意 : Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产 生 请把他存成一般文字档并改变存取权限 chmod a+rx _________________________________________________________________ #!/bin/ksh # CVS program slist # Program to

   
  4.6 slist

注意 : Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产


请把他存成一般文字档并改变存取权限 chmod a+rx
_________________________________________________________________

#!/bin/ksh

# CVS program slist
# Program to list all edited source files from CVS

#cmdname=`basename $0`

#echo "no of params : " $#
#echo "all args : " $@

recurse_flag=""

if [ "$1" = "" ]; then
dir=.
recurse_flag=""
else
dir=$@
recurse_flag=" -prune "
fi

FOUT=slist_temporary_file.out

\rm -f $FOUT

find $dir $recurse_flag -type f -exec ls -ltr {} \; \
| grep -v "/CVS/" \
| grep ^\-rw \
| grep -v \\.o \
| grep -v \\.log \
| grep -v \\.out \
| grep -v \\.pid \
| awk '{ if ($NF != "tags") print $0 }' \
| awk '{ if ($NF != "a.out") print $0 }' \
| awk '{ if ($NF != "core") print $0 }' \
| awk '{ print $NF }' > $FOUT

aa=`cat $FOUT`
\rm -f $FOUT

for ii in $aa ; do
ftype=" "
ftype=`file $ii | awk '{print $2 }' `

# find . -type f -exec file {} \;
# 1)ELF 2)commands 3)[nt]roff, 4)c 5)English 6)executable
# 7)ascii 8)current 9)empty
# Binaries are ELF, lib.a are current
#
if [ "$ftype" = "ascii" -o "$ftype" = "commands" \
-o "$ftype" = "[nt]roff," -o "$ftype" = "c" -o "$ftype" = "data
" \
-o "$ftype" = "English" -o "$ftype" = "executable" ]; then
pcfile=` echo $ii | cut -d'.' -f1`
pcfile=${pcfile}".pc"
if [ ! -f $pcfile ]; then
ls -l $ii
else
if [ "$ii" = "$pcfile" ]; then
ls -l $ii
fi
fi
fi
done;

#| grep -v ^\-rwx \

#ls -l | grep ^\-rw | grep -v \\.o
#ls -l | grep ^\-rw | grep -v \\.o | awk '{ if ($NF != "tags") print $0 }'
#ls -l | grep ^\-rw | grep -v ^\-rwx | grep -v \\.o | awk '{ if ($NF != "tags"
) print $0 }' | awk '{ if ($NF != "core") print $0 }'

#print "\nDone $cmdname. $cmdname suclearcase/" target="_blank" >ccessful"
#print "\nTip (Usage): $cmdname \n"
_________________________________________________________________

4.7 sinfo

注意 : Korn shell /bin/ksh 在你从Linux CD-ROM 安装 pdksh*.rpm 时就会产


请把他存成一般文字档并改变存取权限 chmod a+rx
_________________________________________________________________

#!/bin/ksh

# CVS program sinfo
# Program to get the status of files in working directory

cmdname=`basename $0`

if [ $# -lt 1 ]; then
print "\nUsage: $cmdname [file/directory name] "
print "For example - "
print " $cmdname foo.cpp"
print " $cmdname some_directory "
print " "
exit
fi

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

tmpfile=$hme/cvs_sinfo.tmp
rm -f $tmpfile

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

# Create subshell
if [ -f $1 ]; then
(
cd $hme
clear
cvs status $fdname
)
elif [ -d $1 ]; then
(
cd $hme
clear
echo " " >> $tmpfile
echo " ****************************************" >> $tmpfile
echo " Overall Status of Directory" >> $tmpfile
echo " ****************************************" >> $tmpfile
cvs release $fdname 1>>$tmpfile 2>>$tmpfile << EOF
Y
EOF
echo "\n -------------------------------\n" >> $tmpfile

aa=`cat $tmpfile | grep ^"M " | awk '{print $2}' `
for ii in $aa
do
jj="(cd $hme; cvs status $subdir/$ii );"
echo $jj | /bin/sh \
| grep -v Sticky | awk '{if (NF != 0) print $0}' \
1>>$tmpfile 2>>$tmpfile
done

cat $tmpfile | grep -v ^? | grep -v "Are you sure you want to release"
\
| less
rm -f $tmpfile
)
else
print "\nArgument $1 if not a file or directory"
exit
fi

原文转自:http://www.ltesting.net