[NTLUG:Discuss] Is this the way it's supposed to work?
Leroy Tennison
leroy_tennison at prodigy.net
Wed Apr 29 23:29:42 CDT 2009
Chris Cox wrote:
> On Wed, 2009-04-29 at 02:01 -0500, Leroy Tennison wrote:
>> (BTW, I'm running SuSE 10.3.) Given a directory with the following
>> subdirectories (others removed for brevity):
>>
>> Desktop
>> Documents
>>
>> Doing
>>
>> cd De*
>
> Evaluates do Desktop if the above are the only directories
> at the current level.
>
>> puts me in the Desktop subdirectory. At this point doing
>>
>> cd ../Do*
>
> The .. means parent directory of the current, then
> Do* evaluates (matches) Documents.
>
>> puts me in the Documents directory. Next, doing
>>
>> cd D*
>
> Nope... assuming you're in the Documents directory,
> you'd need to do cd ../D* ... UNLESS
>
> you have CDPATH setup (echo $CDPATH). Then, similar
> to PATH, the CDPATH is searched when relative (non fully
> qualified) change directory requests are given. Since
> cd D* isn't fully qualified, it looks local first then
> it would peruse your CDPATH if set and see if it
> can find a match. You need to be careful with things
> like CDPATH since it can take you to contexts that
> are very outside what you're doing (resulting sometimes
> in unexpected/sad results).
>
>> puts me in the Desktop subdirectory.
>>
>> I first discovered this by accident in DOS under Windows then thought
>> "Is it the same under Linux?" I think the 'cd D*' returns an error
>> under Windows, don't have a installed copy at home so I can't test.
>>
>>
>> From my DOS programming days (yes, I'm THAT old!) I remember findfirst
>> and findnext and thus understand what's probably going on behind the
>> scenes. I'm just surprised that this kind of fuzziness exists in the
>> UI. Bug or feature (or both)?
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>
Yea, I fouled up on the 'cd D*', I had changed back to the parent. It's
what I get for composing emails way too early in the morning...
More information about the Discuss
mailing list