Todd Denniston wrote:
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)"

Timur,

FWIW, this will work as long as the top-level directory name is always different than the repository directory name; ie, '1639' instead of 'repository'. If you every use it in a hierarchy where you didn't use the 'cvs checkout -d new_name ...' option it will return the parent directory name; in your case 'tabi'.


--
----------------
Mark E. Hamilton
Orion International Technologies, Inc.
Sandia National Laboratory, NM.
505-844-7666



_______________________________________________
Info-cvs mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/info-cvs

Reply via email to