1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 1085
/ 2 Years ago, fri, august 19, 2022, 12:13:57
I have a simple shell script on my Ubuntu 13.10 Server to download all files in a list.
filen="/home/chester/test/workobject.txt"
dir_log="/home/chester/test"
if [ -f "$filen" ]
then
cd $dir_log
for n in `cat $filen`
do
echo $n
wget -O $n.txt -q http://domain.com/QuickSearch?object=$n&search=Overview
done
else
echo "Nothing to do."
fi
The contents of workobject.txt
:
9957881
9A39879
The script works properly. However, when it downloads the 9957881.txt
files, it changes the filename to 9Z44X7~P.txt
instead.
What is wrong with the script?
More From » command-line