When you have AI but you don’t have permission to use a package manager.
Using ChatGPT to make Bash palatable
31–40 of 148 posts
Re: Using ChatGPT to make Bash palatable
#32I just bought a Streamdeck ( https://www.amazon.com/Elgato-Stream-Deck-Controller-customi... ) for Cybermonday and attached bash scripts similar to those mentioned by the author to buttons next to my keyboard. It is delightful.
Re: Using ChatGPT to make Bash palatable
#33ChatGPT has been amazing for all kinds of programming-adjacent things, even in my line of work where I asked it for help modifying the config file for a selfhosted gitlab instance. > But [Bash] fucking sucks. Like, it’s truly awful to write [...] As an aside, considering how basic the shell script actually was, I think this is a great example of being so intimidated by something that you don't actually try and use it…
Bash isn't that bad... except there are 20 ways to do anything and 18 of them are wrong, but only 1% of online examples will use either of the two correct approaches and simply reading docs won't always clue you in about how the technique or syntax it's describing is actually subtly wrong and you should ~never use it.
Re: Using ChatGPT to make Bash palatable
#34Re: Using ChatGPT to make Bash palatable
#35I just bought a Streamdeck ( https://www.amazon.com/Elgato-Stream-Deck-Controller-customi... ) for Cybermonday and attached bash scripts similar to those mentioned by the author to buttons next to my keyboard. It is delightful.
What action type do you use for your script? "Open"?
Re: Using ChatGPT to make Bash palatable
#36I don't understand how people can look at this and still claim that it's not doing any "actual reasoning".
I ask it for the XOR swap trick and I get:
int a = 5;
int b = 10;
a = a ^ b;
b = a ^ b;
a = a ^ b;
// After the swap, a = 10 and b = 5
I ask for the bitwise OR swap trick and I get: int x = 5;
int y = 10;
x = x | y;
y = x | y;
x = x | y;
// After the swap, x = 10 and y = 5
When asked for something which is invalid, but close to something it knows, it tends to produce stuff like this -- pattern matching it's best guess.Re: Using ChatGPT to make Bash palatable
#37I find it interesting how much harder it is to grok bash/sh/zsh than other languages I’ve learned. Off the top of my head it may be tooling like the lack of linting, or maybe it’s just experience as I avoid complexity like the plague when writing bash which sounds like a self fulfilling feedback loop. Gpt does seem to unblock this mental burden a bit which has me excited for its potential when it comes to education/t…
PICK = can you
THE=tell the
RIGHT=difference\ between
WHAY="all of"
TODO='these versions?'Re: Using ChatGPT to make Bash palatable
#38I fail to see a single bashism.
Re: Using ChatGPT to make Bash palatable
#39Earlier quoted context omitted.
Bash isn't that bad... except there are 20 ways to do anything and 18 of them are wrong, but only 1% of online examples will use either of the two correct approaches and simply reading docs won't always clue you in about how the technique or syntax it's describing is actually subtly wrong and you should ~never use it.
I find integrating shellcheck into my text editor was one of the best things I've done for increasing my productivity when writing shell scripts.
Re: Using ChatGPT to make Bash palatable
#40I don't understand how people can look at this and still claim that it's not doing any "actual reasoning".
Chat GPT is simply amazing, it feels like Google with super powers. I think it can boost productivity by a considerable amount. It makes a perfect peer programmer, giving you sample code with first class comments explaining the generated code, sometimes with minor errors to make it compile. You can even ask it to explain some specific part of the code. It's also like having a secretary or an assistant available 24/7…