Probably easiest to iterate over the whole list in this case (as wget
doesn't seem to have support for the dynamic creation of output file names):
while read url; do
t=${url##*/} # removes protocol and hostname
pdf=${t%@*} # removes part from @ onwards
wget -O "$pdf" "$url"
done < LIST-OF-URLs
url
is the URL read from the list of URLs in the file, pdf
is just the file name part of it.
In case the names are non-unique you can add a number to the file name, e.g. like this (assuming all files are PDFs):
i=0
while read url; do
t=${url##*/} # removes protocol and hostname
pdf=${t%.pdf@*} # removes part from .pdf@ onwards
wget -O "$pdf-$i.pdf" "$url"
((i++))
done < LIST-OF-URLs
or (if the files have different suffixes)
i=0
while read url; do
t=${pdf##*/} # removes protocol and hostname
pdf=${t%@*} # removes part from @ onwards
wget -O "$i-$pdf" "$url"
((i++))
done < LIST-OF-URLs
pythonbook.pdf
, then that parameter string is the only thing that distinguishes those filenames. In such case you need to elaborate the final naming convention