Artificial intelligent assistant

enf of file unexpected (excepting "f$ing "fi") os: pfSense (nanobsd) shell: csh script: /etc/rc.conf_mount_rw mount -t msdosfs /dev/da0s1 /mnt/usb if ( -s /var/squid/log/access.log ) then cat /var/squid/log/access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e' > /mnt/usb/access_`date +%Y-%m-%d-%H-%M`.log echo "Log wurde gespeichert" else echo "Logfile ist leer, kein Logfile geschrieben" endif /etc/rc.conf_mount_ro Throws following error: /scripts/copy-script.sh: 14: Syntax error: end of file unexpected (expecting "f$ing "fi") Any Suggestions?

You should add the shebang line at the beginning of your script.


#!/bin/csh


So that it will be executed with the `/bin/csh` and not with the `/bin/sh`.

The error looks like your script is executed with `sh`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy e6412af5684d701dda5069c6b7a6376f