Issue
How can I output a multipline string in Bash without using multiple echo calls like so:
echo "usage: up [--level <n>| -n <levels>][--help][--version]"
echo
echo "Report bugs to: "
echo "up home page: "
I'm looking for a portable way to do this, using only Bash builtins.
Solution
Here documents are often used for this purpose.
cat << EOF
usage: up [--level <n>| -n <levels>][--help][--version]
Report bugs to:
up home page:
EOF
They are supported in all Bourne-derived shells including all versions of Bash.
Answered By - Dennis Williamson Answer Checked By - Pedro (WPSolving Volunteer)