trying to implement the other way round: copy from terminal to text file. but, apparently, my thoughts are not compatible to javascript.