[leglug-users] Some help... with bash scripting
Chady Kassouf
chady.kassouf at gmail.com
Thu May 25 02:39:02 EDT 2006
You may want to change some parts... like the first check should check $3
and not $1
and you may replace the while and incrementor with a for loop.
and you have three variables for the same thing (dir)
something like this (untested)
#!/bin/bash
# npd.sh v0.2
# newspaper downloader
if [ -z "$3" ]; then
echo 'Insert date DD MM YY ex: 31 12 99'
exit
fi
Dir="$3-$2-$1";
mkdir "$Dir";
pushd "$Dir";
for A in `seq 1 1 25`; do
wget "http://www.almustaqbal.com/Issues/AsISPDF/$Dir/page$A.pdf
<http://www.almustaqbal.com/Issues/AsISPDF/$D/page$A.pdf>";
done
popd
mv "$Dir" d:/news/;
--
Chady 'Leviathan' Kassouf
http://chady.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.leglug.org/pipermail/leglug-users/attachments/20060525/7fa4fd9f/attachment.htm
More information about the leglug-users
mailing list