a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

pbpaste in shell script

Open woncheol-kim opened this issue 1 year ago • 1 comments

I copied a YouTube URL and tried following commands but failed:

yt-dlp | pbpaste

Then

yt-dlp $(pbpaste)

Then I tried a shell script like this:

set pb = $(pbpaste) yt-dlp $pb set =

Now that all these tries failed, I'm wondering what's the correct command or script.Both yt-dlp and pbpaste work well in a-Shell.

woncheol-kim avatar May 11 '24 10:05 woncheol-kim

For these things, the "xargs" command is great: "pbpaste | xargs yt-dlp" should do what you want (it sends its input to the arguments of the command that follows).

holzschu avatar May 11 '24 15:05 holzschu