# HG changeset patch # User "Yann E. MORIN" # Date 1242074687 0 # Node ID 93d889b9d9bd5212e7d61f0415a056daa928caf9 # Parent 61e81db78cf4146243e937845f1df2388c1830b9 configure: - as per: http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html section "application Usage", change all occurences of: echo "..." with: printf "...\n" -------- diffstat follows -------- /trunk/configure | 46 22 24 0 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff -r 61e81db78cf4 -r 93d889b9d9bd configure --- a/configure Mon May 11 20:24:29 2009 +0000 +++ b/configure Mon May 11 20:44:47 2009 +0000 @@ -18,7 +18,7 @@ # Simply print the error message, and exit. Obvious, he? do_error() { - echo "${myname}: ${@}" + printf "${myname}: ${@}\n" exit 1 } @@ -29,11 +29,11 @@ get_optval(){ case "$1" in --*=?*) - echo "${1#*=}" + printf "${1#*=}" return 0 ;; *) - echo "${2}" + printf "${2}" return 1 ;; esac @@ -100,7 +100,6 @@ local val local item local where - local version local status for item in "${@}"; do @@ -128,8 +127,7 @@ printf "no\n" continue elif [ -n "${ver}" ]; then - version=$( ${where} --version 2>&1 ) - str=$( echo "${version}" |grep -E "${ver}" |head -n 1 ) + str=$( "${where}" --version 2>&1 |grep -E "${ver}" |head -n 1 ) if [ -z "${str}" ]; then printf "no\n" unset where @@ -243,7 +241,7 @@ --with-*) set_tool "$1" "$2" && shift || shift 2;; --force) FORCE=1; shift;; --help|-h) do_help; exit 0;; - *) echo "Unrecognised option: '${1}'"; do_help; exit 1;; + *) printf "Unrecognised option: '${1}'\n"; do_help; exit 1;; esac done @@ -265,54 +263,54 @@ # We check for grep and sed manually, because they are used in has_or_abort printf "Checking for 'grep'... " if [ -n "${grep}" ]; then - echo "${grep} (cached)" + printf "${grep} (cached)\n" else grep="$( which grep 2>/dev/null )" if [ -z "${grep}" ]; then - echo "not found" + printf "not found\n" else - echo "${grep}" + printf "${grep}\n" printf "Checking whether '${grep}' supports -E... " if echo 'foo' |"${grep}" -E 'foo' >/dev/null 2>&1; then - echo "yes" + printf "yes\n" else - echo "no" + printf "no\n" grep= fi fi fi if [ -z "${grep}" ]; then - echo "Either you are missing entirely the needed tool," - echo "or the version you have is too old." - echo "You can give the path to this tool using: --with-grep=PATH" + printf "Either you are missing entirely the needed tool,\n" + printf "or the version you have is too old.\n" + printf "You can give the path to this tool using: --with-grep=PATH\n" do_error "Bailing out..." fi add_to_var_list grep printf "Checking for 'sed'... " if [ -n "${sed}" ]; then - echo "${sed} (cached)" + printf "${sed} (cached)\n" else sed="$( which sed 2>/dev/null )" if [ -z "${sed}" ]; then - echo "not found" + printf "not found\n" else - echo "${sed}" + printf "${sed}\n" printf "Checking whether '${sed}' supports -i and -e... " touch .ct-ng.sed.test if "${sed}" -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then - echo "yes" + printf "yes\n" else - echo "no" + printf "no\n" sed= fi rm -f .ct-ng.sed.test fi fi if [ -z "${sed}" ]; then - echo "Either you are missing entirely the needed tool," - echo "or the version you have is too old." - echo "You can give the path to this tool using: --with-sed=PATH" + printf "Either you are missing entirely the needed tool,\n" + printf "or the version you have is too old.\n" + printf "You can give the path to this tool using: --with-sed=PATH\n" do_error "Bailing out..." fi add_to_var_list sed @@ -386,7 +384,7 @@ esac # Arrange to have no / in the directory name, no need to create an # arbitrarily deep directory structure - VERSION="$( echo "${VERSION}" |"${sed}" -r -e 's|/+|_|g;' )" + VERSION="$( printf "${VERSION}\n" |"${sed}" -r -e 's|/+|_|g;' )" ;; esac echo "${VERSION}"