Often I'd like the command I just typed to put into the clipboard, and I'd like to do it from the command line.
I came up with:
alias cl="fc -ln -1 | sed 's/^\s*//' | xsel -b"
To alias cl to that pipeline which seems to achieve the desired effect, but it seems complicated and has a trailing newline that I don't want. Any obvious and simpler way which doesn't have a trailing newline?