[geany/geany-plugins] e9cb0f: Don't use "echo -n" in shell scripts

Jiří Techet git-noreply at xxxxx
Fri Feb 13 11:34:05 UTC 2015

Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Fri, 13 Feb 2015 11:34:05 UTC
Commit:      e9cb0f9ed07bae1f52fbc0893023542ba01eb6fc

Log Message:
Don't use "echo -n" in shell scripts

The standard says:

If the first operand is -n, or if any of the operands contain a
backslash ( '\' ) character, the results are implementation-defined.

On OS X it simply prints the "-n" string and everything which follows,
including the newline.

Use printf instead.

Modified Paths:

Modified: build/status.m4
4 lines changed, 2 insertions(+), 2 deletions(-)
@@ -28,9 +28,9 @@ AC_DEFUN([_GP_STATUS_PRINT_INDENT_],
         plugin="    ${line%:*}:"
         let extracols=$2-${#plugin}
-        echo -n "$plugin"
+        printf "$plugin"
         for (( i=0; $i<$extracols; i++ )); do
-            echo -n ' '
+            printf ' '
         echo $status
     done << GPEOF

Modified: po/intl_stats.sh
2 lines changed, 1 insertions(+), 1 deletions(-)
@@ -92,7 +92,7 @@ else
      # maybe the regexp can be optimized, regexps are not my best friends
      creationdate=`grep "PO-Revision-Date:" po/$lang.po | sed 's/.*: \([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}[+|-][0-9]\{4\}\).*/\1/'`
-     echo -n $eswitch $lang"\t("$creationdate"):\t"
+     printf "%s %s\t(%s):\t" "$eswitch" "$lang" "$creationdate"
      msgfmt --check --statistics po/$lang.po;

This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).

More information about the Plugins-Commits mailing list