in reply to Re^4: Read File into array and split
in thread Read File into array and split

Let me make this clear this script below is working fine.

So use it.

the only thing is instead of getting dir and hostnames from the script itself i need to read from text file.

I guess you do want to use mine after all.