I developed and maintain a ruby gem called Githug and I am trying to write an automated test script for it. Githug basically manipulates a directory to put it into differen
As commented, printf is the preferred option, as illustrated in Git 2.14.x/2.15 (Q4 2017)
printf '%s\n%s' "$FULL_NAME" "$EMAIL"
See commit 1a6d468 (17 Sep 2017) by Torsten Bögershausen (tboegi).
(Merged by Torsten Bögershausen -- tboegi -- in commit 1a6d468, 21 Sep 2017)
test-lint
:echo -e
(or-E
) is not portableSome implementations of
echo
support the '-e
' option to enable backslash interpretation of the following string.
As an addition, they support '-E
' to turn it off.However, none of these are portable, POSIX doesn't even mention them, and many implementations don't support them.
A check for '
-n
' is already done in check-non-portable-shell.pl, extend it to cover '-n
', '-e
' or '-E
'.
Wrong shebang:
#! /bin/sh
When it shall be a bash script, use
#! /bin/bash
Bash has a buildin echo, which isn't 100% identic with /bin/echo.