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;









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?










share|improve this question


































    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?










    share|improve this question






























      0












      0








      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?










      share|improve this question

















      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






      share|improve this question
















      share|improve this question













      share|improve this question




      share|improve this question








      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























          1 Answer
          1






          active

          oldest

          votes


















          3


















          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).






          share|improve this answer





















          • 1





            or, to save the echo call and the pipe, just: <<<"$clipboard" xclip

            – dessert
            Jun 8 at 20:42












          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
          );



          );














          draft saved

          draft discarded
















          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









          3


















          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).






          share|improve this answer





















          • 1





            or, to save the echo call and the pipe, just: <<<"$clipboard" xclip

            – dessert
            Jun 8 at 20:42















          3


















          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).






          share|improve this answer





















          • 1





            or, to save the echo call and the pipe, just: <<<"$clipboard" xclip

            – dessert
            Jun 8 at 20:42













          3














          3










          3









          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).






          share|improve this answer














          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).







          share|improve this answer













          share|improve this answer




          share|improve this answer










          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 the echo call and the pipe, just: <<<"$clipboard" xclip

            – dessert
            Jun 8 at 20:42












          • 1





            or, to save the echo 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


















          draft saved

          draft discarded















































          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.




          draft saved


          draft discarded














          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





















































          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









          Popular posts from this blog

          Tamil (spriik) Luke uk diar | Nawigatjuun

          Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

          Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?