Hi,
Thanks for the reference to the problem with dos/unix file formats.
I carried out the suggested changes to the file formats using vim and the program now works correctly from any directory.
It was written originally under Windows, hence the dos file formatting.
Thanks for all the help, Trev