Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

heredoc remove leading space tabs linux bash


If you don't need command substitution and parameter expansion inside your here-document, you can avoid using tabs by adding the leading spaces to the delimiter:

$     cat << '    EOF'
>         indented
>     EOF
        indented
$     cat << '    EOF' | sed -r 's/^ {8}//'
>         unindented
>     EOF
unindented
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #heredoc #remove #leading #space #tabs #linux #bash
ADD COMMENT
Topic
Name
2+4 =