From: wessels <> Date: Mon, 26 Jun 2000 11:34:14 +0000 (+0000) Subject: DW: X-Git-Tag: SQUID_3_0_PRE1~1917 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9053e37a0178cb1b55aa08c280128e2f85a75323;p=thirdparty%2Fsquid.git DW: - echo '\n' is not portable in /bin/sh - put echo commands without variables in single quotes --- diff --git a/src/repl_modules.sh b/src/repl_modules.sh index 5bf454bc40..e4e10604d8 100755 --- a/src/repl_modules.sh +++ b/src/repl_modules.sh @@ -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 '}'