[leglug-users] Some help... with bash scripting
Maxim
badran at gmail.com
Wed May 24 19:49:15 EDT 2006
ok this is the v0.2
here you have a bit more controle and better dir naming (in the end the dir
is moved to d:/ as I am on an XP box with cygwin , Need windows for net...
soon moving to zenwalk
=============
#!/bin/bash
# npd.sh v0.2
# newspaper downloader
if [ -z "$1" ]; then
echo 'Insert date DD MM YY ex: 31 12 99'
exit
fi
Dir="$3 $2 $1";
D="$1-$2-$3";
mkdir "$Dir";
cd "$Dir";
A=1;
while [ $A -lt 25 ];
do
wget "http://www.almustaqbal.com/Issues/AsISPDF/$D/page$A.pdf";
((A+=1));
mv "$dir" d:/news/;
done
============
On 5/25/06, Maxim <badran at gmail.com> wrote:
>
> This is my first try at bash scripting. It seams to do its job, but I
> still want to add some features to make it more usefull like checking the
> date format as it should be DD-MM-YY and so on ..... any hints on how to do
> that
>
> ============
> #!/bin/bash
> # newspaper.sh v0.1
> # newspaper downloader
> if [ -z "$1" ]; then
> echo 'Insert date DD-MM-YY ex: 31-12-99'
> exit
> fi
> D=$1
> mkdir $D;
> cd $D;
> A=1;
> while [ $A -lt 24 ];
> do
> wget http://www.almustaqbal.com/Issues/AsISPDF/$D/page$A.pdf;
> ((A+=1));
> done
> ============
>
> --
> Maxim
> msn: m at xim.uni.cc
> skype: maxim_badran
>
--
Maxim
msn: m at xim.uni.cc
skype: maxim_badran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.leglug.org/pipermail/leglug-users/attachments/20060525/905af869/attachment.htm
More information about the leglug-users
mailing list