I need a tool or utility that can take a text file and copy each line onto the clipboard in a way so I can paste back the text line by line by continuously pressing Ctlr-V.
For example, if the text holds these lines
line 1 line 2 line 3
Then I will get:
Ctlr-v: line 1 Ctlr-v: line 2 Ctlr-v: line 3
I need it for pasting lines into the terminal when debugging telnet sessions. It is very tedious to copy and paste the lines one by one.
Does such a tool exists, or can it be created using xclip or similar?
It is for Debian based distros if that makes any difference.
Note: See don_chrissti's comment for a variation to the accepted solution that worked for me.
This is the script I ended up with. Note the use of double backslash to retain the newlines from the text file.
while IFS= read -r line; do printf %s\\n "$line" | xclip -l 1 -quiet -selection primary done < telnet
It works very well for testing smtp connections over telnet which is my use of it.