Cygwin compatibility Questions
Schaible, Joerg
Joerg.Schaible@gft.de
Mon May 31 21:10:00 GMT 1999
>> This seems inconsistent that pwd doesn't always return a path with
>> the drive letter. Any pwd command my scripts issue might or might
>> not return a drive letter.
>Suggestion: create your own pwd so that it always returns the the full
win32
>path. See the cygwin api docmentation.
You may use the following function (I've added it to my .bashrc):
function dirpath
{
pushd $1 > /dev/null 2>&1
echo $(cmd /c cd)
popd > /dev/null 2>&1
}
Jörg
> -----Original Message-----
> From: Earnie Boyd [SMTP:earnie_boyd@yahoo.com]
> Sent: Wednesday, May 05, 1999 8:23 PM
> To: flawlor@us.ibm.com
> Cc: cygwin users
> Subject: Re: Cygwin compatibility Questions
>
> --- flawlor@us.ibm.com wrote:
> >
> >
> > Thanks a lot for the quick response.
> >
> > I did a little more testing and the problem wasn't exactly what I first
> > thought,
> > but let me give you a couple commands that illustrate it a little more
> > clearly.
> > I checked that I was correctly invoking the cygwin pwd command.
> >
> > set -x
> > oldpath=`pwd`
> > cd E:/temp
> > epath=`pwd`
> >
> > Cygwin is installed on my C: drive and the bash shell starts off in
> > C:/WINNT/Profiles/flawlor/Desktop.
> >
> > The result of the above script yields:
> >
> > oldpath=/WINNT/Profiles/flawlor/Desktop
> > epath=//E/temp
> >
>
> Well, that is the way it works now. In the snapshots and the next release
> B21
> epath will map to /cygpath/e/temp just to give you a heads up.
>
> This has to do with the mapping and remapping of the filesystem paths.
>
>
> > It seems that whenever I am on my 'home' disk, there is no drive letter
> > returned by pwd.
> > This seems fine within the script as a cd to a path without a drive
> letter
> > assumes the 'home' drive.
> >
> > The problem comes, for example, when I try to pass these paths to
> executables
> > which are running on a different drive. They make the assumption
> > that it is a path on their current drive and cannot find it if they are
> not
> > running from the 'home' drive, e.g.,
> >
> > E:/temp/somefunc.exe -f ${oldpath}/thedata
> >
> > fails because $oldpath doesn't have any drive letter and 'somefunc'
> > is trying to find it on the E: drive.
> >
>
> Only if somefunc.exe is a non-cygwin program. cygwin built program a
> cygwin
> path aware and would work as you would like them too.
>
> > This seems inconsistent that pwd doesn't always return a path with
> > the drive letter. Any pwd command my scripts issue might or might
> > not return a drive letter.
>
> Suggestion: create your own pwd so that it always returns the the full
> win32
> path. See the cygwin api docmentation.
> ===
> "Earnie Boyd" < mailto:earnie_boyd@yahoo.com >
> CYGWIN RELATED HELP:
> DOCUMENTATION: < http://sourceware.cygnus.com/cygwin/docs.html >
> DLLHELP: < http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ >
> ARCHIVE SEARCH: < http://www.delorie.com/archives/ > OR
> < http://www.eGroups.com/list/gnu-win32/ >
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list