I'm using curl and grep to get the URL of an image, after that I'd like to download the image itself, and copy it to the clipboard directly, rather than saving it to the disk temporarily before. I'm puzzled that the output doesn't seem to work. It only gives me "text" rather than the image itself. Here's the command I have so far:
curl -s https://www.tradingview.com/x/4WuY06rl/ | grep -oE "src='[^']+'" | sed -E "s/src='([^']+)'/\1/" | xargs curl -s | pbcopy
If there's an easier solution to this, please let me know. The command is built around the idea that the website here has only ONE img
tag.