in reply to globing unc path

aha! I looked into the problem and found that \ is an escape character in glob expressions so \\server\share is being interpreted as \server\share.

>perl -le"print for glob shift" \\tribble05\c$\* >md \tribble05\c$\foo >perl -le"print for glob shift" \\tribble05\c$\* \tribble05\c$\foo >>perl -le"print for glob shift" \\\\tribble05\c$\* \\tribble05\c$\AUTOEXEC.BAT ... >perl -le"print for glob shift" //tribble05/c$/* //tribble05/c$/AUTOEXEC.BAT ...

The \ doesn't need to be doubled in front of "*" because of hack used on Windows builds. From bsd_glob.c:

/* To avoid backslashitis on Win32, * we only treat \ as a quoting character * if it precedes one of the * metacharacters []-{}~\ */

Replies are listed 'Best First'.
Re^2: globing unc path
by Anonymous Monk on Nov 08, 2007 at 13:58 UTC
    The //machine_name/junk/* worked! Thanks ikegami!