Linux download wildcard URL

188 views Asked by At

Using my script I'd like to be able to go to Chef Inspec and download the latest version. However the URL they use has versions. The versions will change and eventually, if I hard code the URL, I won't be getting the latest.

How do I use the wget command with wildcards to always get the latest version and never have to check it?

Here is the URL they offer:

https://packages.chef.io/files/stable/inspec/2.3.4/ubuntu/16.04/inspec_2.3.4-1_amd64.deb

I just want it downloaded and autoinstalled, but when the version changes I'm going to fall behind.

UPDATE: This doesn't answer the question exactly, but works. What I ended up doing was using the Curl command. This gave me the end result needed:

curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P inspec

1

There are 1 answers

0
Florian Weimer On

You should add their repository to /etc/apt/sources.list. Then you can use apt to update their software.

Debian has a tool called uscan which can download from URLs using wildcards, but this isn't the right tool for installing packages.