之前我曾问过这个,但现在下面的bash
似乎删除并下载了输入文件中的所有文件。基本上输入中的所有行(6)都是文件,并被读入$line
变量。当我echo
$line
我可以看到那里的文件并且它们会被删除,但它们也会被下载,我不需要它们,我也不确定它们为什么这样做。谢谢你:)。
强文
file1.txt
file2.txt
file3.txt
file1.pdf
file2.pdf
file3.pdf
的bash
# add filenames as variable and remove files from list
while read line; do
echo $line (only there to verify that the files are in the variable)
wget --user=xxxxx --password=xxx --xxxx --method=DELETE \
xxx://www.example.com/xx/xxx/xxx/$line
done < /home/cmccabe/list
rm /home/cmccabe/list
答案 0 :(得分:2)
您可以使用-O /dev/null
选项,即:
wget --user=xxxxx --password=xxx --xxxx --method=DELETE \
xxx://www.example.com/xx/xxx/xxx/$line -O /dev/null
放弃wget's
输出并避免保存输出文件。