If I have a directory,
/export/web/sun
Which contains lots of other directories of the following format....
explorer.hostid.hostname-2002.09.10.21.10
hostid is an unknown alphanumeric string and the date at the end of the directory name is also unknown...
I have an array containing only a list of hostnames.
What is the easiest way for me to then find the corresponding directory for that hostname (given that I only know the hostname and not the rest of the directory name such as the hostid or the date at the end)
Ideally I just want to be able to say
$hostdir=/export/web/sun/explorer.*.$hostname-*
But the easiest way i've found so far seems to be this
my $file="/export/web/sun/explorer.*${hostname}-*";
if (@showrev=glob "${file}" {
print @file;
}
Can anyone think of a simpler way of doing this?