I have an identical file on two systems but one system is running Debian 8 and the other is 11
#!/bin/sh ### BEGIN INIT INFO # Provides: warner # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO [email protected] subject="$1" from=`hostname`@blabla.com daemail=$(cat <<! From: $from To: $to Subject: $subject $2 You might want to check this... !) echo "$daemail" | /usr/sbin/sendmail -t
Now on one system (deb8), it works as expected but on the other, I'm getting an error
/etc/init.d/warner: 24: Syntax error: end of file unexpected (expecting ")")
Now when I change the interpter to /bin/bash on the deb11 script, it works. Why the /bin/sh throws this error on newer Debian?