[nSLUG] cat-like command

Daniel Morrison draker at gmail.com
Mon Dec 21 14:10:08 AST 2009

2009/12/21 Ted Tibbetts <intuited at gmail.com>:
> $ cat file | xclip -selection clipboard
> If you leave out the option, it goes into the (primary) X "selection", not
> the clipboard, meaning that to get it out you click the middle mouse button

> With parcellite you just pipe into parcellite, à la
> $ cat file | parcellite
> Parcellite assumes that you want that to be saved to the "clipboard"

Hardly a show-stopper for xclip:

$ cat <<EOF > ~/bin/parcellite
> #!/bin/sh
> exec xclip -selection clipboard "$@"
$ chmod 755 !$

> It also keeps a history stack that you can browse to find
> previously-clipped (via Edit->Copy, CTRL-[SHIFT-]C, "+yiW, etc) or -piped-in

How does it do that? Oh, it's GUI. Not like 'cat'... and I don't have
a window dock.

Nice to know though, and your other points are quite valid on the
various uses of such a program.

BTW, it does seem that the X selection depends entirely on the mouse.
It's possible (for instance, in a web form) to use 'Shift-Tab', 'Tab'
to focus on a text field and cause all the text to be "selected".
Backspace or delete to clear it, and then 'middle-click paste'.

I will confess to finding it frustrating that I can't just
middle-click paste. When I do that, it behaves as though nothing had
been selected for some reason -- pasting the new text in the middle of
the old text.

Thanks for the input,


More information about the nSLUG mailing list