made changes to work on csh according to mharris