cb
, a command-line clipboard, inspired by psub
command of fish
shell.
Copy cb
to a directory on PATH, such as ~/bin/
.
To copy the output of a command line to the clipboard,
a-command-line | cb
To paste the contents of the clipboard to another command line,
cb | another-command-line
To show the contents of the clipboard,
cb
Open a new terminal and change directory to the same directory of the current terminal.
Type in a current terminal:
pwd | cb
Then open a new terminal and type in it:
cd $(cb)