Skip to content

Instantly share code, notes, and snippets.

@aeppert
Created December 22, 2016 19:12
Show Gist options
  • Select an option

  • Save aeppert/3b10f1891748f7bb84b595e81b2e131a to your computer and use it in GitHub Desktop.

Select an option

Save aeppert/3b10f1891748f7bb84b595e81b2e131a to your computer and use it in GitHub Desktop.
#!/bin/bash
# autossh.x86_64 1.4e-1.el7 @epel
# puppetlabs-stdlib.noarch 4.5.1-2.20150121git7a91f20.el7 @epel
IFS=$'\n'
get_filename() {
local line=$1
echo $i | awk '{
split($0,a,".");
split(a[2],b," ");
split($0,c," ");
print "http://mirror.math.princeton.edu/pub/epel/7/x86_64/" substr(a[1],0,1) "/" a[1] "-" c[2] "." b[1] ".rpm";
}'
}
for i in `cat fetch.list`
do
fn=$(get_filename $i)
curl -O $fn
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment