osx - Unable to have pbcopy -clipboard inside Screen -


The problem was not solved despite accepting an answer: We worked to do Jonah Are working to get the code.

Problem: (1) to change the code (2)

I know I want to be able to run the following code inside the screen I

Code (1)

  cat ~ / .vimrc | Pbcopy (1)  

Code (2)

  cat ~ / Vimrc & gt; /tmp/pbcopy.pipe (2)  

My attempt to resolve this problem: .zshrc

  function pbcopy () {"(Cat \" $ 1 \ ")" & gt; /tmp/pbcopy.pipe}  

I get

  cat massey | Pbcopy pbcopy: Command not found: (cat "") cat: masi: Any such file or directory  

How can you use pbcopy inside the screen?

OK, this is a bad answer, but this is also a mistake, so at least they match We do. You can create a named pipe, and then setup an endless loop that reads the files from the designated pipe and gives them pbcopy (or xsel , xclip code>, etc.).

1. In a terminal which is not in a screen session (run it only once):

  / Usr / bin / mkfifo /tmp/pbcopy.pipe While correct; Do / bin / cat /tmp/pbcopy.pipe | / Usr / bin / pbcopy;  

If you want to change it to a shell script (it should probably be stronger)

  #! / Bin / bash if [[-e /tmp/pbcopy.pipe]]; Then echo "It seems that I am already running" echo "removing /tmp/pbcopy.pipe If you are certain that I am not right then" exit 1 "Do / bin / cat / tmp / pbcopy .pipe | / Usr / bin / pbcopy  

which you can name as pbcopy_server.sh , make executable ( chmod a + x Pbcopy_server.sh ) and somewhere on your own, so that you can call nohup pbcopy_server.sh & amp; when you start your machine for the first time.

< P> 2. Any other terminal ( You can now redirect program output to cat files (or /tmp/pbcopy.pip) and the text will appear in the clipboard.

  cat file> Tmp / pbcopy.pipe df -h & gt; /tmp/pbcopy.pipe  

3. To see if you are the actual Pbcopy You can use something to cat'ing for /tmp/pbcopy.pipe .

3a. Zsh function:

  function pbcopy () {cat> /tmp/pbcopy.pipe}  

3b Create a Perl script named or pbcopy and place it in the directory in your e> Pat to / usr / bin : < / P>

  #! Use / usr / bin / perl strict; Use warnings; Open my $ out, "& gt;", "/tmp/pbcopy.pipe" or die "Could not open pbcopy: $! \ N"; Print out $ _ $ & lt; & Gt ;;  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -