top | item 23763762

(no title)

psophis | 5 years ago

You can also use add a hyphen ( <<-EOF ) to suppress leading tabs but not spaces. https://linuxhint.com/bash-heredoc-tutorial/

discuss

order

smichel17|5 years ago

I've always avoided that for fear that my or someone else's editor will accidentally replace the tabs with space. Mixed is not a common configuration, these days.

account42|5 years ago

This makes me want to use this just to get people to fix their broken editors.

yjftsjthsd-h|5 years ago

Oh, that's nice! And in spite of the labeling on that page, it doesn't seem to be a BASHism; it at least works in dash, too.

e12e|5 years ago

And ksh.

amelius|5 years ago

Seriously, bash has too many obscure features.

emmelaich|5 years ago

Ruby and Perl have `here` docs as well.

And Ruby 2.5 has an enhancement which preserves leading whitespace.

dungdongdang|5 years ago

a commonly used feature that has been a part of the unix standard since before "bash" only meant to hit something with a heavy object, while linus was getting his diaper changed is not an "obscure feature."

a five year old took his first aware car ride, and at a gas station saw the trunk of the car next to theirs open. he said "seriously, bmw has too many obscure features." after all, a car for him was where you put the baby seat. and why would you put that in a compartment with no windows or air, that's too small to even fit a baby seat.

did you enjoy the ride?