[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to determine the working directory?

From: James R Kirk
Subject: Re: How to determine the working directory?
Date: Thu, 1 Dec 2005 13:04:52 -0500

address@hidden 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:
> [tabi: ~/1639/source] cvs query directory
> /home/tabi/1639
> [tabi: ~/1639/source]
> The reason I do this is that I create a sandbox for each bug that I
> work on, and I often work on several bugs at once.  In this case, I'm
> working on bug 1639.  I would like to write some shell scripts that
> need to know where the top level directory of my sandbox is.  I've
> search the Internet and the man pages, and I see no way to do this.

Here are shell hacks that seem to do what you want:

sh:      ( basename `cat CVS/Repository` > XX$$ ; XX=`cat XX$$` ;  pwd | sed "s/$XX.*//" )
csh:   ( basename `cat CVS/Repository` > XX$$ ; setenv XX `cat XX$$` ; pwd | sed "s/$XX.*//" )
reply via email to

[Prev in Thread] Current Thread [Next in Thread]