This is very basic, sorry if this is a duplicate, but search results give me something opposite.
I want to paste lines as an input to a pipe. How can I do it?
For example I want to use this answer https://stackoverflow.com/a/18141152/2361465 to sum a line of numbers. I could save my numbers into a file and do
cat numbers.txt | paste -sd+ - | bc
But my numbers are in the clipboard. Or they are in my head and I want to enter them manually. How do I feed them as the input without saving to a file?
I don't want the shell to read the Ubuntu clipboard, I want some command
??? that after execution waits for the input (with some way of indicating its end) and then passes it to the pipe.
??? | paste -sd+ - | bc