[Info-vax] DIRECTORY: bug or feature
Ken Fairfield
ken.fairfield at gmail.com
Wed May 30 13:38:53 EDT 2012
On Wednesday, May 30, 2012 10:10:06 AM UTC-7, Phillip Helbig---undress to reply wrote:
> The command
>
> $ DIR []*.AA,*.AB
>
> shows the same output as
>
> $ DIR []
>
> if only *.AA and *.AB are in the directory. Ditto for
>
> $ DIR []*.A*
>
> Extending this,
>
> $ DIR [...]*.A*
>
> produces similar results. However,
>
> $ DIR [...]*.AA,*.AB
>
> will list directories twice, once with *.AA and then again with *.AB.
>
> Has the behaviour always been this way?
Yep, pretty sure it's always been this way.
> Bug or feature?
Neither. Just known behaviour.
> Wouldn't things be more logical if the second and fourth commands
> produced the same output, since the first and third do?
You'd probably need to get into the esoterica of RMS parsing
to understand it completely. You're already having to apply
RMS "sticky" defaults to the second filespec in the list, "*.AB",
in order to get the "[...]" applied to it.
My *guess* is that DIRECTORY sort of keeps track of the last
directory spec that was searched as it finds files matching
the request, and prints that directory specification if it
hasn't previously when it's found a file. The second file spec
in your list (*.AB) resets the last directory searched because
of the sticky [...], so it needs to print the directory spec
(again) when it finds the matching file.
-Ken
More information about the Info-vax
mailing list