#!/bin/sh STR="-e" echo ${STR} STR="${STR} HI" echo ${STR}
The above script prints:
HI
after an empty line. Why is this and how to create a line starting with "-e"?
echonot a very good UNIX citizen. If that were good, you could write echo -- "$STR", with --, indicating the end of the list of options. But this is not so, therefore you cannot.
echo
echo -- "$STR"
--
Best used printf.
printf
printf '%s\n' "$STR"