Is it possible to copy a variable to the Shift+Insert clipboard from the command line?How do you know when to use SHIFT+INSERT vs CTRL-V vs right-click-paste to paste?Why can't I copy text from the Ubuntu Terminal?How can I copy the path to the currently opened file in gedit to the clipboard?How to copy an image to the clipboard from a file using command line?How can I copy text from xfce4 terminal emulator to the clipboard?Pasting text into terminal editors always pastes into a single line on Ubuntu for Windows (10)How to copy terminal command in clipboard without using mouse?
For the Dungeon of the Mad Mage adventure, which dimension is used to determine a room's ceiling height?
Multiline Tag command
Is exploit-free software possible?
Mysql - Average price for top 10% cheapest volume (algorithm help)
Right way to say I disagree with the design but ok I will do
Impeachment jury tampering
Continents with simplex noise
How did the T-850 still function after it removed its second battery?
numpy 1D array: mask elements that repeat more than n times
Are the Properties of the EM Spectrum Fluid?
What is the "more" means here?
How to help my son improve without being discouraging?
What are some examples of three-mora atamadaka verbs besides 帰る?
Why does the passage the Letwin amendment "scrap the possibility of a meaningful vote on Johnson's deal"?
Why don't my appliances work when my tester shows voltage at the outlets?
What are the applications of the Mean Value Theorem?
What does "speed checked" mean?
How much transparency about runway should I expect from startup employer?
What would be the best propulsion system for this aircraft carrier?
Meaning of 'off one's brake fluid'
indent and noindent: details from Knuth's The TeXbook
Why would Basel III prevent price discovery at credit markets?
Can I select any of my published paper in journal for book chapter
Suspicious connections coming from Firefox (possible malware)
Is it possible to copy a variable to the Shift+Insert clipboard from the command line?
How do you know when to use SHIFT+INSERT vs CTRL-V vs right-click-paste to paste?Why can't I copy text from the Ubuntu Terminal?How can I copy the path to the currently opened file in gedit to the clipboard?How to copy an image to the clipboard from a file using command line?How can I copy text from xfce4 terminal emulator to the clipboard?Pasting text into terminal editors always pastes into a single line on Ubuntu for Windows (10)How to copy terminal command in clipboard without using mouse?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
When I create scripts, I use the xclip
command to copy a variable to the clipboard, so I can paste it using CTRL+V
or automate my script to paste it with xdotool
. The command that I use to copy a variable to the clipboard is this one:
echo -n "$clipboard" | xclip -selection clipboard
It works fine for pasting with CTRL+V
... However, many times I want to paste things on a terminal window and only Shift+Insert
works for that. For some reason xclip
doesn't copy variables to the clipboard that Shift+Insert
uses, it only happens when I copy some text manually with CTRL+C
. Does anyone know if there's a way of programmatically copying a variable to the same clipboard that Shift+Insert uses?
command-line bash clipboard xclip
add a comment
|
When I create scripts, I use the xclip
command to copy a variable to the clipboard, so I can paste it using CTRL+V
or automate my script to paste it with xdotool
. The command that I use to copy a variable to the clipboard is this one:
echo -n "$clipboard" | xclip -selection clipboard
It works fine for pasting with CTRL+V
... However, many times I want to paste things on a terminal window and only Shift+Insert
works for that. For some reason xclip
doesn't copy variables to the clipboard that Shift+Insert
uses, it only happens when I copy some text manually with CTRL+C
. Does anyone know if there's a way of programmatically copying a variable to the same clipboard that Shift+Insert uses?
command-line bash clipboard xclip
add a comment
|
When I create scripts, I use the xclip
command to copy a variable to the clipboard, so I can paste it using CTRL+V
or automate my script to paste it with xdotool
. The command that I use to copy a variable to the clipboard is this one:
echo -n "$clipboard" | xclip -selection clipboard
It works fine for pasting with CTRL+V
... However, many times I want to paste things on a terminal window and only Shift+Insert
works for that. For some reason xclip
doesn't copy variables to the clipboard that Shift+Insert
uses, it only happens when I copy some text manually with CTRL+C
. Does anyone know if there's a way of programmatically copying a variable to the same clipboard that Shift+Insert uses?
command-line bash clipboard xclip
When I create scripts, I use the xclip
command to copy a variable to the clipboard, so I can paste it using CTRL+V
or automate my script to paste it with xdotool
. The command that I use to copy a variable to the clipboard is this one:
echo -n "$clipboard" | xclip -selection clipboard
It works fine for pasting with CTRL+V
... However, many times I want to paste things on a terminal window and only Shift+Insert
works for that. For some reason xclip
doesn't copy variables to the clipboard that Shift+Insert
uses, it only happens when I copy some text manually with CTRL+C
. Does anyone know if there's a way of programmatically copying a variable to the same clipboard that Shift+Insert uses?
command-line bash clipboard xclip
command-line bash clipboard xclip
edited Jun 8 at 18:14
Rafael Muynarsk
asked Jun 8 at 18:06
Rafael MuynarskRafael Muynarsk
7157 silver badges23 bronze badges
7157 silver badges23 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
Shift+Insert
uses the XA_PRIMARY
selection. So:
echo -n "$clipboard" | xclip -selection primary
or just
echo -n "$clipboard" | xclip
(since XA_PRIMARY
is the default).
1
or, to save theecho
call and the pipe, just:<<<"$clipboard" xclip
– dessert
Jun 8 at 20:42
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1149634%2fis-it-possible-to-copy-a-variable-to-the-shiftinsert-clipboard-from-the-command%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Shift+Insert
uses the XA_PRIMARY
selection. So:
echo -n "$clipboard" | xclip -selection primary
or just
echo -n "$clipboard" | xclip
(since XA_PRIMARY
is the default).
1
or, to save theecho
call and the pipe, just:<<<"$clipboard" xclip
– dessert
Jun 8 at 20:42
add a comment
|
Shift+Insert
uses the XA_PRIMARY
selection. So:
echo -n "$clipboard" | xclip -selection primary
or just
echo -n "$clipboard" | xclip
(since XA_PRIMARY
is the default).
1
or, to save theecho
call and the pipe, just:<<<"$clipboard" xclip
– dessert
Jun 8 at 20:42
add a comment
|
Shift+Insert
uses the XA_PRIMARY
selection. So:
echo -n "$clipboard" | xclip -selection primary
or just
echo -n "$clipboard" | xclip
(since XA_PRIMARY
is the default).
Shift+Insert
uses the XA_PRIMARY
selection. So:
echo -n "$clipboard" | xclip -selection primary
or just
echo -n "$clipboard" | xclip
(since XA_PRIMARY
is the default).
answered Jun 8 at 19:07
steeldriversteeldriver
80.9k12 gold badges131 silver badges216 bronze badges
80.9k12 gold badges131 silver badges216 bronze badges
1
or, to save theecho
call and the pipe, just:<<<"$clipboard" xclip
– dessert
Jun 8 at 20:42
add a comment
|
1
or, to save theecho
call and the pipe, just:<<<"$clipboard" xclip
– dessert
Jun 8 at 20:42
1
1
or, to save the
echo
call and the pipe, just: <<<"$clipboard" xclip
– dessert
Jun 8 at 20:42
or, to save the
echo
call and the pipe, just: <<<"$clipboard" xclip
– dessert
Jun 8 at 20:42
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1149634%2fis-it-possible-to-copy-a-variable-to-the-shiftinsert-clipboard-from-the-command%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown