What should I use instead of "echo" to pass the URL to a terminal program?
Y yagoa macrumors newbie Original poster Dec 9, 2011 2 0 May 6, 2017 #1 What should I use instead of "echo" to pass the URL to a terminal program?
superscape macrumors 6502a Feb 12, 2008 937 223 East Riding of Yorkshire, UK May 8, 2017 #2 Hi, I'm guessing you're wanting to pass the URLs to "youtube-dl" as a parameter, right? Also, I'm assuming that if you type: youtube-dl "http://some.valid.url/whatever" ...then it works for you. In which case, the passed arguments come in as the variable $@. So you need to loop through the list like this: Code: for f in "$@" do #your download code goes here youtube-dl "$f" done I wrote a short guide to doing this a little while ago here: https://www.ghostotter.com/making-shell-scripts-little-user-friendly/ ...you may find it useful! Good luck. Last edited: May 9, 2017
Hi, I'm guessing you're wanting to pass the URLs to "youtube-dl" as a parameter, right? Also, I'm assuming that if you type: youtube-dl "http://some.valid.url/whatever" ...then it works for you. In which case, the passed arguments come in as the variable $@. So you need to loop through the list like this: Code: for f in "$@" do #your download code goes here youtube-dl "$f" done I wrote a short guide to doing this a little while ago here: https://www.ghostotter.com/making-shell-scripts-little-user-friendly/ ...you may find it useful! Good luck.