#!/bin/sh < list sort -R | while read -r url do file="$(echo "$url" | sed -e "s|.*/||")" if ! [ -f "$file" ] then curl -LO "$url" case "$file" in *.tar.*) tar xf "$file" ;; *) dir="${file%.*}" mkdir $dir cd $dir 7z e ../"$file" cd .. ;; esac fi done