Questions tagged [pbcopy]
32 questions
1
vote
2 answers
In Python3/OS X, how to pass a string with apostrophe to a terminal command?
I have a Python 3 application that should at some point put a string into the clipboard. I am using system commands echo and pbcopy and it works properly. However, when the string includes an apostrophe (and who knows, maybe other special…

Victor Domingos
- 1,003
- 1
- 18
- 40
1
vote
1 answer
How to copy in Terminal without mouse
I want to copy text in Terminal without using my mouse. For example to store a commit hash when doing a git log and use it for another command. Anyone has an idea how to move the cursor up and copy, maybe turning on something like a copy/visual mode…

bynite
- 11
- 2
1
vote
1 answer
Bash shells script 101 - variable definition, pbcopy, etc
I am trying to create a (my first) bash script, but I need a little help. I have the following:
#!/bin/bash
echo "Write a LaTeX equation:"
read -e TeXFormula
URIEncoded = node -p "encodeURIComponent('$(sed "s/'/\\\'/g" <<<"$TeXFormula")')"
curl…

casparjespersen
- 3,460
- 5
- 38
- 63
1
vote
0 answers
the difference between element_to_bytes() and element_snprint() in pbc library
I want to convert the pbc element_t to the human-friendly string. those two functions seems alike to satisfy the goal. however,I want to know the usage in detail about those. Thanks in advance.

bing han
- 17
- 3
1
vote
1 answer
Solaris equivalent to OS X's pbcopy / pbpaste?
OS X has nice commands for manipulating the clipboard: pbcopy and pbpaste
I could really use something similar in Solaris 10. I've checked for xsel and xclip, and Solaris 10 doesn't have them. Am I completely out of luck?

user3358338
- 49
- 2
1
vote
2 answers
Is there a nice way to copy columns of text from a file using regex into my pasteboard?
Currently, the solution that I have is kind of ugly and is pretty spaghetti-code like... is there a nice way to do this with a "standard" tool like ack?
What I have right now is a file that is in this format:
crap.txt:
IdentifierA Some…

kakigoori
- 1,218
- 10
- 20
0
votes
0 answers
How to Copy a File in Node.js to the Clipboard
I want to copy a file in order to paste it later back into an application. I want to copy it exactly like I would do it manually (not only the content of that file).
import childProcess from 'child_process';
const filePath =…

Andi Giga
- 3,744
- 9
- 38
- 68
0
votes
1 answer
Is this a pbcopy command garbled bug?
Is this a pbcopy command garbled bug?
If so, is there a way to fix it?
I've tried a few ways but still can't found why this is happened.
update
open it in the terminal is ok, but garbled when open it in a file editor(vscode)
# ✅ terminal
$ cat…

xgqfrms
- 10,077
- 1
- 69
- 68
0
votes
1 answer
pbcopy Specific Part of Shell Script
I am using the goo.gl URL shortener to shorten URL's with a curl command. The command is below:
curl https://www.googleapis.com/urlshortener/v1/url \
-H 'Content-Type: application/json' \
-d '{"longUrl": "http://www.google.com/"}'
This returns…
0
votes
1 answer
AppleScript isn't running do shell command with pbcopy
Very new to applescripts and any code outside of VBA in general.
I am running the code below to debug an issue in a larger code block.
If I run the do shell script by pasting the line into Terminal, I will get a numerical value on my clipboard based…

Striccara
- 1
- 1
0
votes
0 answers
pbcopy in Python to copy to the clipboard on OSX?
I am receiving the following error when trying to use pbcopy to add the output to the clipboard. I tried different variations of the command and still no luck.
Does anyone have any ideas where I may have failed?
Error Screenshot:
#!/usr/bin/env…

Howie B
- 21
- 3
0
votes
1 answer
Is it possible to copy remote origin url to clipboard using Bash on Mac (Darwin 17)?
I've tried one command line:
pbcopy < git remote get-url origin
And other way:
output.txt < git remote get-url origin
But I get next message:
-bash: git: No such file or directory
Any ways?
P.S. Git version: 2.13.3, OS Version: macOS High Sierra…

devshok
- 737
- 1
- 8
- 19
0
votes
0 answers
pbcopy via shell_exec() not working with native PHP installed in MAC Sierra by default
I want to copy some text sent by browser to clipboard after making changes using PHP and I can do that with PHP installed via AMPPS or XAMPP but when I try it with PHP which comes by default on Sierra I'm neither getting any error message nor the…

user3649424
- 11
- 2
0
votes
1 answer
How to copy input from from the clipboard using pbcopy and setting that to another file that can then be called by pbpaste
I want to get the data from the main clipboard onto my own file so that when the user executes a command they can retrieve the information set upon that second file. Alternatively I could also pbcopy direcly into the second file and run that command…

Carla Rivers
- 63
- 1
- 7
0
votes
0 answers
Homebrew formula that only sets up launchd
I want to create a homebrew formula that will only setup some launchd configurations. Specifically it will bind /usr/bin/pbcopy and /usr/bin/pbpaste to a port so that I can expose these to my remote development envirnoment.
Everything I have read…

Oliver Nightingale
- 1,805
- 1
- 17
- 22