0

I need echo this construction and cannot use additional quotes


#!/bin/bash

set -x

export jaz="-e test \
        -e test2 \
        -e test3
        "
echo $jaz

result is

tuy$ sh test.sh
+ export 'jaz=-e test   -e test2    -e test3
'
+ jaz='-e test  -e test2    -e test3
'
+ echo -e test -e test2 -e test3
test -e test2 -e test3

but must be "-e test -e test2 -e test3" "-e" on first position is lost

tuytuy20
  • 95
  • 5
  • This behavior is coming from the echo options : -e enable interpretation of backslash escapes (from man echo) – admstg Apr 06 '23 at 09:36

0 Answers0