This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: /bin/pwd versus built-in pwd


Based on the man page for 'pwd':

 "...That is, all components of the printed name will be actual
  directory names -- none will be symbolic links."

I'd say this is a bug.

As a quick hack, in the meantime, assuming you are using bash or ksh, run the following:

cygpath -u $(cygpath -w $PWD)

The first cygpath eliminates the symbolic link since they don't work as such in Windows, the second converts back to the expacted absolute path, sanse symbolic links.

Fred Kulack wrote:
> 
> I just upgraded from an older cygwin 1.1.x release to the current one.
> 
> It use to be that I could use /bin/pwd instead of the bash built-in
> If I wanted to get the full directory name of the cwd instead
> of the softlink name.
> 
> For example, in the following,
>  > ls -ld //f/kulack/l/jdb44
> lrw-r--r--   1 kulack   None           85 Sep 26 14:51 //f/kulack/l/jdb44
> ->
> //W/as400/v4r4m0.java/cur/cmvc/java.pgm/jdb.java/src/com/ibm/db2/jdbc/app/
> 
> pwd would give /cygdrive/f/
> /bin/pwd would give
> /cygdrive/w/as400/v4r4m0.java/cur/cmvc/java.pgm/jdb.java/src/com/ibm/db2/jdbc/app/
> 
> Now, both give the directory name of the soft link //f/kulack/l/jdb44
> I need the full path in some scripts and tools.
> Are there any alternative utils that can give me the full name?
> Thanks!
> 
> dll version information from cygcheck -v -s
>    56k 2000/12/03 c:\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0
>                   "cygbz21.0.dll" v0.0 ts=2000/11/20 17:53
>    45k 2000/12/07 c:\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
>                   "cygform5.dll" v0.0 ts=2000/12/7 0:41
>    18k 2000/10/23 c:\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
>                   "cyggdbm.dll" v0.0 ts=2000/10/22 21:26
>    17k 2001/01/07 c:\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
>                   "cyghistory4.dll" v0.0 ts=2001/1/6 22:34
>    14k 2000/10/23 c:\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
>                   "cygintl.dll" v0.0 ts=2000/10/23 14:02
>    81k 2000/12/05 c:\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
>                   "cygitcl30.dll" v0.0 ts=2000/11/25 19:43
>    35k 2000/12/05 c:\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
>                   "cygitk30.dll" v0.0 ts=2000/11/25 19:43
>    45k 2000/10/22 c:\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
>                   "cygjbig1.dll" v0.0 ts=2000/10/22 18:06
>   119k 2000/10/23 c:\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
>                   "cygjpeg6b.dll" v0.0 ts=2000/10/22 19:58
>    26k 2000/12/07 c:\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
>                   "cygmenu5.dll" v0.0 ts=2000/12/7 0:40
>   159k 2000/12/07 c:\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
>                   "cygncurses++5.dll" v0.0 ts=2000/12/7 0:42
>   225k 2000/12/07 c:\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
>                   "cygncurses5.dll" v0.0 ts=2000/12/7 0:39
>    15k 2000/12/07 c:\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
>                   "cygpanel5.dll" v0.0 ts=2000/12/7 0:40
>   162k 2000/10/23 c:\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
>                   "cygpng2.dll" v0.0 ts=2000/10/22 19:40
>   108k 2001/01/07 c:\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
>                   "cygreadline4.dll" v0.0 ts=2001/1/6 22:34
>   390k 2000/12/05 c:\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
>                   "cygtcl80.dll" v0.0 ts=2000/11/25 19:39
>     5k 2000/12/05 c:\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
>    10k 2000/12/05 c:\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
>                   "cygtclreg80.dll" v0.0 ts=2000/11/25 19:39
>   243k 2000/10/23 c:\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
>                   "cygtiff3.dll" v0.0 ts=2000/10/22 20:14
>   623k 2000/12/05 c:\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
>                   "cygtk80.dll" v0.0 ts=2000/11/25 19:43
>    41k 2000/11/20 c:\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0
>                   "cygXpm-noX4.dll" v0.0 ts=2000/11/19 20:41
>    45k 2000/11/20 c:\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0
>                   "cygXpm-X4.dll" v0.0 ts=2000/11/19 20:45
>    49k 2000/10/23 c:\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
>                   "cygz.dll" v0.0 ts=2000/10/22 19:22
>   611k 2000/12/25 c:\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
>                   "cygwin1.dll" v0.0 ts=2000/12/25 11:39
>     Cygwin DLL version info:
>         dll major: 1001
>         dll minor: 7
>         dll epoch: 19
>         dll bad signal mask: 19005
>         dll old termios: 5
>         dll malloc env: 28
>         api major: 0
>         api minor: 31
>         shared data: 3
>         dll identifier: cygwin1
>         mount registry: 2
>         cygnus registry name: Cygnus Solutions
>         cygwin registry name: Cygwin
>         program options name: Program Options
>         cygwin mount registry name: mounts v2
>         cygdrive flags: cygdrive flags
>         cygdrive prefix: cygdrive prefix
>         cygdrive default prefix:
>         build date: Mon Dec 25 12:39:48 EST 2000
>         shared id: cygwin1S3
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]