Skip to content

Commit 59d26bd

Browse files
bk2204gitster
authored andcommitted
thunderbird-patch-inline: avoid bashism
The use of "echo -e" is not portable and not specified by POSIX. dash does not support any options except "-n", and so this script will not work on operating systems which use that as /bin/sh. Fortunately, the solution is easy: switch to printf(1), which is specified by POSIX and allows the escape sequences we want to use. This will allow the script to work with any POSIX shell. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2f323bb commit 59d26bd

File tree

1 file changed

+1
-1
lines changed
  • contrib/thunderbird-patch-inline

1 file changed

+1
-1
lines changed

contrib/thunderbird-patch-inline/appp.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ BODY=$(sed -e "1,/${SEP}/d" $1)
3131
CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}")
3232
DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
3333

34-
CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
34+
CCS=$(printf '%s\n%s\n' "$CMT_MSG" "$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
3535
-e 's/^Signed-off-by: \(.*\)/\1,/gp')
3636

3737
echo "$SUBJECT" > $1

0 commit comments

Comments
 (0)