Examples of using clipboard in the shell
Both Mac and Windows come with cmd tooling to help with copying to the clipboard.
pbcopy
pbpaste# you need to quote !! after it expands
echo !! | clipcopy
# to paste
clippaste
# or to execute
$(clippaste)- Window subsytem for linux (WSL) copy to clipboard from the command line? here