generalize "write" -- file output + shell pipes