attach and write to stdin