bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Squiggly heredoc - new feature request


From: Přemysl Šťastný
Subject: Squiggly heredoc - new feature request
Date: Mon, 30 Aug 2021 22:06:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Hello.

I have a problem with indentation in bash scripts with here documents. Normally, I use spaces for indentation, eg.

func()(
  blabla
)

But if need to use here doc document in a function, I am forced to do eather

func()(
  cat <<- EOF
        blabla
        EOF
)

or

func()(
  cat << EOF
blabla
EOF
)

I think, it would be nice, if you implemented Squiggly heredoc, which solves this problem by ignoring both leading spaces and leading tabs. eg.

func()(
  cat <<~ EOF
    blabla
  EOF
)

Would it be possible please? If I get your approval, I can implement it to bash myself.

Thanks.

Best regards
Přemysl Šťastný

Attachment: OpenPGP_0x2FD4F23C65C1A5F0_and_old_rev.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]