[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT][bash] Anfänger hat Probleme mit Schleifen



Hallo Lothar,

Lothar Schweikle-Droll wrote:
> Wie würde man so eine Schleife richtig Programieren?
> 
> For i=1 to $GESAMTLAENGE step $SCHRIIWEITE ## Diese Zeile  ist so natürlich falsch
> 
>     echo "TRACK AUDIO" >> $ZIELDATEI
>     echo "NO COPY" >> $ZIELDATEI
>     echo "FILE /"$DATEINAME/" $ZAEHLER $ZAEHLER+$i >> $ZIELDATEI
>     echo " " >> $ZIELDATEI
> 		
>  $ZAEHLER=$ZAEHLER+$i
>   
> NEXT

Vielleicht tuts eine while-Schleife:

  #!/bin/bash
  COUNTER=0
  while [  $COUNTER -lt 10 ]; do
    echo The counter is $COUNTER
    let COUNTER=COUNTER+1
  done

BTW, aus /usr/share/doc/HOWTO/en-txt/Bash-Prog-Intro-HOWTO.gz

Gruß,
Martin



Reply to: