[leglug-users] Some help... with bash scripting

Chady Kassouf chady.kassouf at gmail.com
Thu May 25 10:56:25 EDT 2006


On 5/25/06, Maxim <badran at gmail.com> wrote:
>
> in the Url the dir is stated as "DD-MM-YY" but on my PC i save them as YY
> MM DD for better listing... this is why I have multiple dir variables... as
> for the variable checking thanks for the update.
>
> About the loop , does it work better this way ???
>

Not necessarily better, it's yet another way to do it.



On 5/25/06, Chady Kassouf <chady.kassouf at gmail.com> wrote:
>
> > 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/
>
> _______________________________________________
> leglug-users mailing list
> leglug-users at lists.leglug.org
> http://lists.leglug.org/mailman/listinfo/leglug-users
>
>
>
>
>
> --
>      Maxim
> msn: m at xim.uni.cc
> skype: maxim_badran
>
> _______________________________________________
> leglug-users mailing list
> leglug-users at lists.leglug.org
> http://lists.leglug.org/mailman/listinfo/leglug-users
>
>
>


-- 
Chady 'Leviathan' Kassouf
http://chady.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.leglug.org/pipermail/leglug-users/attachments/20060525/679417f5/attachment-0001.htm 


More information about the leglug-users mailing list