[LinuxSIG] ChatGPT to write code [was: Re: bash_httpd.sh]
Dave Hylands
dhylands at gmail.com
Sun Mar 3 07:33:55 PST 2024
There are still some things I prefer to use bash for rather than Python
(usually involving transforming the output of a program). But yeah it’s
amazing what you can do with a well crafted bash script.
I tend to use trap a lot more in scripts that get used in a more production
environment.
I’ve also found myself putting the incantation:
`set -Eeuo pipefail`
at the top of all my bash scripts.
This page gives an detailed explanation of most of what that means:
https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425?permalink_comment_id=3935570
The -E makes trap statements get inherited by shell functions.
I find these options to be extremely useful, especially in build commands
involved by make. Otherwise lots of failures were silently being absorbed
rather than halting the build.
Dave Hylands
Peachland, BC, Canada
http://www.davehylands.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://vicpimakers.ca/pipermail/linuxsig_vicpimakers.ca/attachments/20240303/82fa8283/attachment.htm>
More information about the LinuxSIG
mailing list