I wanted to copy & paste a multi-screen script into LibreOffice for pretty printing and documentation purposes and used these two commands as follows:
Code: Select all
expand -t4 consume-lists | xclip -selection clipboard
Since I'm already at the CLI to do the tab expansion, I might as well use the X clipboard to paste the result into my document so that I don't have to fiddle around with temporary files that I must remember to delete in order to avoid future confusion.
So, running the above intelligently [!] expands the tabs in the "consume-lists" script and puts the result in the clipboard, allowing me to Alt+TAB to LibreOffice, where I simply paste it.