1

Copy file into clipboard line by line

view story
linux-howto

http://askubuntu.com – So I'm using the following script to copy a file line by line into the clipboard: perl -ne 'm/\t(.+)\n/; open(my $pipe, "|xclip -i"); print {$pipe} $1; close($pipe);'\ 'print; `bash -c "read -p continue"`' photo_captions.txt In case that's confusing, my photo_captions.txt file contains lines like: IMG0001.JPG At the beach IMG0002.JPG At the bar Where the captions are preceded by tabs. And the script is just capturing everything after the tab to the newline and stuffing it into xclip, printing that to standard out, and then asking the user to press enter to continue to t (HowTos)