How-to-simply...

Echo text with new lines to file on RHEL

  • 1 echo $'Sample text\n'\
    >$'spanning multiple\n'\
    >$'lines.' > test

References