Is there an Environment Variable that contains the clipboard contents?

前端 未结 5 1506
迷失自我
迷失自我 2021-01-22 20:28

Is there a Bash environment variable (say $CLIPBOARD or similar) that contains the current contents of the clipboard?

The specific example is to see the top

相关标签:
5条回答
  • 2021-01-22 21:05

    I don't really know exactly what you are trying to accomplish. Check out the following article and see if it helps: Remotely transferring clipboard data using netcat and bash

    Update: If you are using OSX, try using pbcopy & pbpaste to copy and paste data from the clipboard.

    0 讨论(0)
  • 2021-01-22 21:05

    This requires an additional command-line utility, but it looks like what you describe:

    Command Line to Clipboard

    0 讨论(0)
  • 2021-01-22 21:07

    No, there isn't a bash environment variable. For your platform (which you don't specify) you may be able to use a command line tool like xclip or one of the many Windows utilities (google for "windows clipboard command line").

    0 讨论(0)
  • 2021-01-22 21:09

    Using xclip combined with Readline bindings in Bash - a bit of a hack, but it works

    http://bash-hackers.org/wiki/doku.php/snipplets/xclip

    0 讨论(0)
  • 2021-01-22 21:30

    You might look into xclip or pbcopy/pbpaste (Mac OS X).

    0 讨论(0)
提交回复
热议问题