Mark E. Hamilton wrote:
Jim Hyslop wrote:
[EMAIL PROTECTED] wrote:
Is there a CVS command that I can issue that will give me the top-level
directory from within /home/tabi/1639/source? That is, something like:
The file CVS/Repository contains the directory within the repository
root. Just be sure not to accidentally change it.
Note that both Jim's suggestion and my suggestion #3 will give you
'repository' rather than '1639', and it won't include the directory
portion (/home/tabi) of the path. I don't know whether that's important
to you or not.
Be careful here, the use of modules can trip you up...
OK, you got my scratch itching...
how about this in bash:
PWD=`pwd`
CVS_REPOSITORY=`cat CVS/Repository`
BPWD=`basename $PWD`
BCR=`basename $CVS_REPOSITORY`
DPWD=`dirname $PWD`
DCR=`dirname $CVS_REPOSITORY`
while [ "$BPWD" == "$BCR" ]
do
BPWD=`basename $DPWD`
BCR=`basename $DCR`
DPWD=`dirname $DPWD`
DCR=`dirname $DCR`
done
echo "base is ($BPWD)"
_______________________________________________
Info-cvs mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/info-cvs