]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Mon, 26 Jun 2000 11:34:14 +0000 (11:34 +0000)
committerwessels <>
Mon, 26 Jun 2000 11:34:14 +0000 (11:34 +0000)
 - echo '\n' is not portable in /bin/sh
 - put echo commands without variables in single quotes

src/repl_modules.sh

index 5bf454bc40fae436a8671047a824a6715bde0dfa..e4e10604d8f22cae9c9dd467ff9fefd5ddb7d62b 100755 (executable)
@@ -1,19 +1,30 @@
 #!/bin/sh
-echo "/* automatically generated `date` by
-echo   * $0 $*"
-echo " * do not edit"
-echo " */"
-echo "#include \"squid.h\""
-echo ""
+
+# NOTE: echo '\n' is not portable.  Some shells interpret and
+# change it to an actual newline character.  The ugly hack here
+# is to use two echo commands:
+#      echo -n 'blah\'
+#      echo 'n'
+# This is probably more portable in Perl.
+
+echo "/* automatically generated `date` by"
+echo " *   $0 $*"
+echo ' * do not edit'
+echo ' */'
+echo '#include "squid.h'
+echo ''
 for module in "$@"; do
    echo "REMOVALPOLICYCREATE createRemovalPolicy_${module};"
 done
-echo "RemovalPolicy * createRemovalPolicy(RemovalPolicySettings *settings)"
-echo "{"
+echo ''
+echo 'RemovalPolicy *'
+echo 'createRemovalPolicy(RemovalPolicySettings *settings)'
+echo '{'
 for module in "$@"; do
-   echo "      if (strcmp(settings->type, \"${module}\") == 0)"
-   echo "              return createRemovalPolicy_${module}(settings->args);"
+   echo "        if (strcmp(settings->type, \"${module}\") == 0)"
+   echo "            return createRemovalPolicy_${module}(settings->args);"
 done
-   echo "      debug(20,1)(\"Unknown policy %s\n\", settings->type);"
-   echo "      return NULL;"
-echo "}"
+   echo -n '        debug(20, 1) ("Unknown policy %s\'
+   echo 'n", settings->type);'
+   echo '        return NULL;'
+echo '}'