distributed script writing to external file with cat()