I'm sorry if this is a duplicate post, but I think I put my reply in the wrong place.
At the momment I am using the following:
But it is still reporting an error, even though, I am running it on the correct host and the file system is on the host. Is the check correct? Am I defreferencing it properly? The first if condition should have been false, but instead it is coming out as true and printing out error.
$host=`hostname`;
$filesystem = ARGV[0];
my %filesystems = (
hosta => (desc => 'x', filesystems => (qq|/dat
+a/file/a| =>0, qq|/data/file/b| =>0)),
tx05 => (desc => 'r',filesystems => (qq|/data/
+file/c| =>0, qq|no filesystemB for 2nd host | => 0)));
if ( ! exists $filesystems{$host}{filesystems}{$filesystem} ) {
print "error\n";}
else {print "Found filesystem $filesystem on host $host\n". $filesyste
+ms{$host}{descr}."\n";}