Is there any easy way to implement the copy to clipboard option from the output of a shell script ?
相关问题
- How to get the return code of a shell script in lu
- JQ: Select when attribute value exists in a bash a
- Invoking Mirth Connect CLI with Powershell script
- Emacs shell: save commit message
- bash print whole line after splitting line with if
相关文章
- 使用2台跳板机的情况下如何使用scp传文件
- In IntelliJ IDEA, how can I create a key binding t
- Check if directory exists on remote machine with s
- shell中反引号 `` 赋值变量问题
- How get the time in milliseconds in FreeBSD?
- Reverse four length of letters with sed in unix
- Launch interactive SSH bash session from PHP
- BASH: Basic if then and variable assignment
You can use
pbcopy
which is native for Mac OS.Try this command:
it will copy the string "variable" into your clipboard.
You can use the
xclip
command.Instructions for obtaining
xclip
are here.echo
prints a newline at the end as well. Incase anyone else hits the same issue, I used Mauro's approach but with theprintf
command so that it's just the string, no extra line:For Mac:
That may depend on the environment you're using. With Gnome at least (I haven't tried the others but it may work), you can pipe your output as follows:
The first goes to the mouse clipboard, the second to the "normal" clipboard.
If you do that on Windows 10 LXXS Ubuntu bash you can do