[Chicago-talk] shell expansion

Steven Lembark lembark at jeeves.wrkhors.com
Thu Nov 6 10:40:01 CST 2003



-- Emil Janev <ejanev2 at yahoo.com>

> Here is a question about small problem ( I think ) with shell expansion
> under Windows.
>
> Under UNIX the following would work naturally:
>
> perl -l -e 'print for @ARGV' *
>
> Everything that could be expanded with "echo *" from the current
> directory will be printed.
>
> Under Windows:
>
> C:\Temp>perl -l -e "print for @ARGV" *
>
> It will print just "*". ( echo * yields the same too ).
>
> I used some technique to have the desired under Windows: Imediatelly at
> the begining of the program:
>
> @ARGV = <@ARGV>;
>
> This basically works, but the same script want be portable to UNIX.
>
> Any sugestion...

Globbing on dos-based systems uses 8.3 notation, which
requires all files to have an extension. All the NT file
system does is layer a long-name database over the 8.3
storage mechanism. To glob all of the files you need to
use "*.*" -- which, of course, breaks *NIX file systems
that don't have built-in extensions.


--
Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                            +1 888 359 3508



More information about the Chicago-talk mailing list