On Mac you can use pbcopy to copy something your pasteboard aka clipboard.
So the first command becomes:
tar -cz dir | base64 | pbcopy
And of course you can use pbpaste for the inverse. Doesn’t work over SSH though, which is almost certainly how you’d be using this.
And of course you can use pbpaste for the inverse. Doesn’t work over SSH though, which is almost certainly how you’d be using this.