#!/bin/bash
#下载存放地址
downdir="/opt/shelltest/downfile/textfile1"
#读取文件
cat $1 | while read line
do
#echo "$line"
cd $downdir
str=$line
#以';'切分文本,我这边的文本格式是:文件url路径;文件名
array=(${str//;/ })
url=${array[0]}
filename=$(echo ${array[1]} | tr -d '\r')
#执行下载
curl $url -o $filename
done
sh downfile.sh xxx.txt