“heredoc remover guias de espaço líder linux bash” Respostas de código

heredoc remover guias de espaço líder 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
DreamCoder

heredoc remover guias de espaço líder linux bash

sed 's/^ *//' >> ~/Desktop/text.txt << EOF
    Load time-out reached and nothing to resume.
    $(date +%T) - Transmission-daemon exiting.
EOF
DreamCoder

heredoc remover guias de espaço líder linux bash


You can change the here-doc operator to <<-. You can then indent both the here-doc and the delimiter with tabs:

#! /bin/bash
cat <<-EOF
    indented
    EOF
echo Done
DreamCoder

heredoc remover guias de espaço líder linux bash

mail_content="Last Change: $dateLastChanged

    This is an automated warning of stale data for the UNC-G Blackboard Snapshot process."
    mailx -r "Systems and Operations <sysadmin@[redacted].edu>" -s "Warning Stale BB Data" jadavis6@[redacted].edu <<<"$mail_content"
DreamCoder

Respostas semelhantes a “heredoc remover guias de espaço líder linux bash”

Perguntas semelhantes a “heredoc remover guias de espaço líder linux bash”

Mais respostas relacionadas para “heredoc remover guias de espaço líder linux bash” em Shell/Bash

Procure respostas de código populares por idioma

Procurar outros idiomas de código