myGully.com

myGully.com (https://mygully.com/index.php)
-   Programmierung (https://mygully.com/forumdisplay.php?f=67)
-   -   Shell-Script: unexpected end of file (https://mygully.com/showthread.php?t=2890539)

Gun_der 05.04.13 07:42

Shell-Script: unexpected end of file
 
Hallo,
ich habe hier folgendes kleines S***** und verstehe nicht ganz, warum immer wieder dieser Fehler auftritt:
line 9: systax error: unexpected ed of file

S*****:
Code:

#!/bin/bash
cat $1 | while read zeile; do
  echo "$zeile";

  if [ "$zeile" == "$2" ] ; then
    echo "NEUEZEILE";
  fi
done

Bin für jede Hilfe dankbar.

Gun_der 05.04.13 10:12

Hat sich erledigt...

Habe schon etwas weiter gemacht:
Code:

#!/bin/bash
NEUEVERANST=$1
NEUESDATUM=$2
NEUERORT=$3
NEUERLINK=$4

function readZeilen {
#Read every Line of the file
cat jahresplan.html | while read line;
 do echo "$line";
  if [ "$line" == "$olddate" ];
  then
    echo "$NEUESDATUM";
    echo "$NEUEVERANST";
    echo "$NEUERORT";
  fi
 done
}

readZeilen


Das wichtigste unter Windows jedoch:
dos2unix.exe s*****name
--> ausführen, damit \r\n zu \n umgewandelt wird....doofe Geschichte


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:19 Uhr.

Powered by vBulletin® (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.