lkml.org 
[lkml]   [2011]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: extra slash in current path
    Am Thu, 23 Jun 2011 18:31:06 +0400
    Michael Tokarev <mjt@tls.msk.ru> schrieb:
    > 23.06.2011 18:11, yuyichao-mit wrote:
    >
    > >>>> $ cd //
    > >>>> $ pwd
    > >>>> //
    >
    > The current directory is cached in $PWD environment
    > variable by shell (bash at least). This variable is
    > checked in glibc (getcwd() et al) - if it is set and
    > stat($PWD) is the same as stat("."), that value is used.

    It also is somehow cached inside bash/dash for it's built in commands.
    $ cd //
    $ export PWD=5
    $ pwd
    //
    $ /bin/pwd
    /


    Regards
    Lars


    \
     
     \ /
      Last update: 2011-06-23 16:55    [W:0.023 / U:0.076 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site