I wanted a simple way to process text in my clipboard without having to create a file. I tried using the following line:
awk '{print $1}' <(cat)
but I couldn't send cat the EOF character using ctrl+d like I normally do. I have a feeling it has something to do with a conflict of the file descriptor its creating to hold the data from cat, but I'm not entirely sure.
In the interim I'm using here documents, but it's ugly.
awk '{print $1}' <<KITTENMITTENStextblahKITTENMITTENS
The problem is it needs to be rather portable (across CLI commands). Any idea on a more elegant solution? Know why the cat line doesn't work?
awk '{print $1}'
, Enter, paste with middle button, Ctrl-D.<(cat)
add? Why not justawk '{print $1}'
ENTER
?-
if the command supports that syntax, or/dev/fd/0
or/dev/stdin
if your systems has that.