项目作者: jrhawley

项目描述 :
Command line clipboard utility
高级语言: Shell
项目地址: git://github.com/jrhawley/cb.git
创建时间: 2019-10-04T18:06:30Z
项目社区:https://github.com/jrhawley/cb

开源协议:

下载


cb

A leak-proof tee to the clipboard

This script is modeled after tee (see man tee).

This was forked from @RichardBronosky into its own tool.

It’s like your normal copy and paste commands, but unified and able to sense when you want it to be chainable

Examples

Copy

  1. $ echo -n $(date) | cb
  2. # clipboard contains: Tue Jan 24 23:00:00 EST 2017
  3. # but, because of `echo -n` there is no newline at the end

Paste

  1. # clipboard retained from the previous block
  2. $ cb
  3. Tue Jan 24 23:00:00 EST 2017
  4. # above there is a newline after the output for readability
  5. # below there is no newline because cb recognized that it was outputing to a pipe and any alterations would "contaminate" the data
  6. $ cb | cat
  7. Tue Jan 24 23:00:00 EST 2017$ cb > foo
  8. # look carefully at this ^^ that's a new $ prompt at the end of the content exactly as copied
  9. $ cat foo
  10. Tue Jan 24 23:00:00 EST 2017

Chaining

  1. $ date | cb | tee updates.log
  2. Tue Jan 24 23:11:11 EST 2017
  3. $ cat updates.log
  4. Tue Jan 24 23:11:11 EST 2017
  5. # clipboard contains: Tue Jan 24 23:11:11 EST 2017