in reply to check for directory no mather what case (linux)
Caveat, depending on the platform the slashes might trip you up (forward or backward), but in general it seems to work when I test it out on my Linux and AIX machines just fine. NOTE: Correction, I had pasted the code from the wrong test script - correct code above now$dir = "/home/Bob/XXX"; $dir =~ m/(\/.*)\/([^\/]+)\/?$/ and ($base,$dirname) = ($1,$2); mkdir $dir unless scalar grep(m/$dirname/i, glob("$base/*"));
|
|---|