From 3967100fd99745e860b5d52ea4db2ba99e39b3a6 Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Mon, 27 May 2019 15:37:52 +0300 Subject: [PATCH] Add Heredoc section --- SC2039.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SC2039.md b/SC2039.md index e31cea9..3a84eaa 100644 --- a/SC2039.md +++ b/SC2039.md @@ -251,6 +251,21 @@ command > file 2>&1 or command 2>&1 | othercommand No Comments / Exceptions +### Heredoc + +Change: +``` +sed 's/some_replacement//g' <<< "${var}" +``` + +To: +``` +printf '%s' "${var}" | sed 's/some_replacement//g' +``` + +No Comments / Exceptions + + ## Exception Depends on what your expected POSIX shell providers would use. \ No newline at end of file