Using ChatGPT to make Bash palatable
71–80 of 148 posts
Re: Using ChatGPT to make Bash palatable
#72Earlier quoted context omitted.
Nope. macOS aliases suck. It’s a binary unmodifiable file that can only point to a file, it can’t specify anything additional.
Is there a reason you can't add a script to your path and alias that? #!/usr/bin/env bash my-command --flag --another-flag $@
Re: Using ChatGPT to make Bash palatable
#73Earlier 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
#74Earlier quoted context omitted.
Is there a reason you can't add a script to your path and alias that? #!/usr/bin/env bash my-command --flag --another-flag $@
As far as I know, you can’t get an executable script like that to act like an app that’s launchable when double clicked from Finder or clicked the Dock. Even though it’s executable.
Re: Using ChatGPT to make Bash palatable
#75"im using mac, not linux" is an often prompt I need to use, but otherwise this type of flow works great for simple bash functions.
For more advanced scripts, prompting & careful flow are important, but I've done some pretty awesome things. Today, ChatGPT helped me create a bash script to create a flat structure of large tars from an nTiB dataset directory by aggregating multiple sub-datasets & their files into the desired tar file size. Eg. "need single tar files of all the data in that folder/subfolder, every tar file must be 50GB, most files range from 4MB-1GB. So, need to aggregate them"
Re: Using ChatGPT to make Bash palatable
#76I 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
#77Earlier quoted context omitted.
It has trained on countless programming tutorials out there, including bash tutorials for all kinds of things. Such tutorials often includes "create file -> ls to see file -> print content of file" etc, so GPT then takes those tutorials and creates grammatical rules how those words transform into each other. But if you start going outside of the realms of online tutorials it starts to falter quickly and then just pri…
To add to this, each token is generated by going through its network once. So there's no way computationally for it to do any reasoning or follow an algorithm. That said though it's impressive how much its able to accomplish without any procedural reasoning.
I think of it as a savant-esque capability. A glimpse of what we might be like if some slices of our language/memory faculties were turned up to 1111 while others are completely absent.
Re: Using ChatGPT to make Bash palatable
#78I feel like I'm the only person among my peers to think this and I don't understand why.
Re: Using ChatGPT to make Bash palatable
#79Am I the only who think this is incredible!? If you would've told me a year ago when we would have an ai that can code based on normal human language prompts, I would've said maybe in 2025 or 2026, but its 2022 and it already exists! Man, if this what we have now, imagine what we will have in 2025 or 2030! I just hope this doesn't end up killing search engines and personal blogs, since no one needs to search for anyt…
Re: Using ChatGPT to make Bash palatable
#80Earlier quoted context omitted.
Here is an example of where I think it is doing "no 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 ten…
Which is why prompt engineering is an emerging domain: You will be given a series of tasks. (1) Complete a task by finishing the simple code block. (2) If a task in the series seems flawed, provide a warning. A task is flawed if I make wrong assumptions about how I think code works. Task 1: Complete this simple code example. Bitwise XOR swap trick: ``` int a = 5; int b = 10; --------------------- // GPT provides simp…