[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] Bash for-loop; s kriv tæller med foranstilled e nuller?



On Sun, 29 Mar 2009 09:30:59 +0200, Kim Jensen <sslug@sslug> wrote:

Erling A. Jacobsen wrote:
Jon Bendtsen wrote:
On 28/03/2009, at 23.04, Michael Schmidt wrote:

Hej NG,
Jeg har lige brugt et bash for-loop:

]$ for i in `seq 1 126`; do wget http://www.example.org/contenpages/article$i.html; done
 udnyt backquotes og printf kommandoen:
for i in `seq 1 126`; do wget http://www.example.org/contenpages/article`printf '%03d' $i`.html; done

Alternativt fortæl seq at den skal foranstille nuller: `seq -w 1 126`.

Se eventuelt "seq --help".

Aha! jeg tænkte ikke over at seq var en selvstændig funktion.
Jeg har heller ikke gennemskuet hvorfor det skal stå omkranset af " ` ", men sådan er det når man googler sig til en løsning baseret på at redigere en lille bitte del af en andens forslag.

Tak for hint, jeg er lært noget nyt og dagen har ikke været spildt. :)


--
Med venlig hilsen
/Zmit/
RLU # 314205


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-04-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *