Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Thanks again, this works a treat. I need to use the extracted url to download the program, using wget variables as I will be downloading lots of programs. Will also need the filename it saves as to be variable, any suggestions on how to do this? Commented Oct 9, 2015 at 10:58
  • If server is configured properly, wget should save data under correct file name automatically. If it does not, try --trust-server-names and/or --content-disposition options. In this particular example, you can extract file name using \/\([^/?]*?\)\? (for one between last slash and question mark) or .*=\(.*\)$ (for one after last equal sign). If URL is already in variable $URL, use something like that: echo "$URL" |sed -e 's:.*=\(.*\)$:\1:' (untested, as I'm not on Linux right now). Commented Oct 9, 2015 at 11:15
  • Also, don't forget to click up arrow near answers that you find helpful and accept answer that you... well, accept. Commented Oct 9, 2015 at 11:15