1

I'm still fairly new to linux. I've been a user for about 2 months. I understand how to do basic pipings with grep and write STDOUT to text files.

I'm trying to do something similar with my clipboard utility gpaste. I'd like to use the text that I copy URL info from my gui browser and paste it into a terminal command. The next step would be to learn how to scrape this information automatically and run it through similar manipulations, but let's not get ahead of ourselves.

My process, I open gpaste ui and copy the youtube url in question. It gets entered into gpaste history. When I enter gpaste get [#] the correct entry is returned, great.

However when I attempt to manipulate that data in another application, like youtube-dl, I run into the error "gpaste is not a recognizable url."

Here's what I've tried:

youtube-dl | gpaste 0
gpaste get [#] | youtube-dl

Not very creative, I know, but what the hey...

Any suggestions?

1

Are you sure youtube-dl can read from stdin? If so your second example should work.

Try youtube-dl $(gpaste get [#])

To make sure $(gpaste get [#]) returns what you expect you can first do echo $(gpaste get [#])

2
  • that worked! Great! Thanks! So whats the deal with the $()? What am I telling bash whenever I do that? – Andrew Sep 29 '15 at 20:56
  • 1
    @AndÚ echo $(whatever commands you want) means that bash executes whatever is between the (..) and what it returns is used as an argument to echo. So if whatever commands you want should print out Hello AndÚ the result woud be echo Hello AndÚ – Nifle Sep 30 '15 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.