This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: echo -e
Also now tested with bash; it works there too.
I wrote:
> Tested with pdksh, it works.
>
> * csu/Makefile: Use printf for consistent backslash handling.
>
> Index: csu/Makefile
> ===================================================================
> RCS file: /cvs/glibc/libc/csu/Makefile,v
> retrieving revision 1.73
> diff -u -r1.73 Makefile
> --- csu/Makefile 8 Mar 2004 21:28:15 -0000 1.73
> +++ csu/Makefile 17 Aug 2004 22:42:53 -0000
> @@ -216,7 +216,8 @@
> $(objpfx)version-info.h: $(common-objpfx)config.make $(all-Banner-files)
> $(make-target-directory)
> (case $(config-os) in \
> - linux*) version=`(echo -e "#include <linux/version.h>\nUTS_RELEASE"\
> + linux*) version=`(printf \
> + "#include <linux/version.h>\nUTS_RELEASE\n"\
> | $(CC) $(CPPFLAGS) -E -P - -DNOT_IN_libc=1 | \
> sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\
> if [ -z "$$version" ]; then \
> @@ -231,13 +232,13 @@
> if [ -z "$$os" ]; then \
> os=Linux; \
> fi; \
> - echo "\"Compiled on a $$os $$version system" \
> - "on `date +%Y-%m-%d`.\\n\"" ;; \
> + printf "\"Compiled on a %s.\\\\n\"\\n" \
> + "$$os $$version system on `date +%Y-%m-%d`" ;; \
> *) ;; \
> esac; \
> files="$(all-Banner-files)"; \
> if test -n "$$files"; then \
> - echo "\"Available extensions:\\n\""; \
> + printf "\"Available extensions:\\\\n\"\\n"; \
> sed -e '/^#/d' -e 's/^[[:space:]]*/ /' \
> -e 's/^\(.*\)$$/\"\1\\n\"/' $$files; \
> fi) > $@T
>
>
> paul