Results 1 to 1 of 1
Hi linuxforums.org
just want shortly introduce myself to u. im simon, 22 years old and studying
the problem: my stupid script does not want to work as i wish it ...
- 01-23-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 1
My script tells me syntax errors
Hi linuxforums.org
just want shortly introduce myself to u. im simon, 22 years old and studying
the problem: my stupid script does not want to work as i wish it to.
Well, the following script tells me(launching it) that there are syntax errors.
./findcuckoo: syntax error at line 26: `;;' unexpectedCode:#! /usr/bin/ksh function travdir { for k in $(ls -l $1) do if test -f $k then overname=$() abosutname=$($1/$k) if test $overname = $2 then print "$overname" print "$absolutname" print "Möchten sie die Datei löschen? y/n" read answer case $answer in y) if rm $1/$k then print "Erfolgreich gelöscht" else print "$overname >> $1/logfile" print "$absolutname >> $1/logfile" fi ;; n) print "Abbruch durch User ;; *) print "Eingabe nicht korrekt" ;; esac fi elif test -d $k then overname=$(ls -ld $1 | cut -c 14-18) absolutname=$($1/$k) if test $overname = $2 then print "$absolutname" print "$overname" print "Möchten sie das Verzeichnis löschen? y/n " read anser case $answer in y) if rmdir $1/$k then print ""erfoglreich gelöscht" else print "$overname >> $1/logfile" print "$absolutname >> $1/logfile" fi ;; n) print "Abbruch durch Benutzer" ;; *) print "Eingabe nicht korrekt" ;; esac else travdir $1/$k $2 fi else print "total 12" fi done return } read startdir user=$USER travdir $startdir $user
im having a similar problem with another script i wrote. so maybe, if u got some time, check the script for mistakes etc.
btw it is supposed to find files within my homedirectory owned by other users.
its a preparation for my examens, so its no homework or sth like that. its just to practise.
regards and thx. simon


Reply With Quote