3 ms·
As a rule, if you can write your code in a file, and run it as a script, it is better than writing scrolls between <<EOF … EOF The why is obvious
by tzury 3y ago
As a rule, if you can write your code in a file, and run it as a script, it is better than writing scrolls between
<<EOF
…
EOF
The why is obvious.
- mattigames 3y agoSome people like their personal full-programs inside a single-file, I think the appeal is that after opening you only have to keep scrolling to continue reading the other "files", or that if you need to attach it to an email or something similar you are sure it has no dependency on other files, but yeah the trade-off is not worth it.
- devoutsalsa 3y agoAnd keeping it one file means you're reducing risk of a breaking change in the external script.
- jonahx 3y agoIt's not obvious to me that the benefits outweigh the benefits of a single, easily readable file.
- d-z-m 3y agoSome would disagree that heredoc'ing your scripts makes them easily readable.
- deleted 3y ago[deleted]