TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using ChatGPT to make Bash palatable

176 pointsby naderkhalilover 2 years ago

29 comments

fariszrover 2 years ago
Am I the only who think this is incredible!?<p>If you would&#x27;ve told me a year ago when we would have an ai that can code based on normal human language prompts, I would&#x27;ve said maybe in 2025 or 2026, but its 2022 and it already exists!<p>Man, if this what we have now, imagine what we will have in 2025 or 2030!<p>I just hope this doesn&#x27;t end up killing search engines and personal blogs, since no one needs to search for anything anymore.<p>Also Ai generated replys are definitely an Extinction level threat for forums and the independent internet in general, let&#x27;s hope OpenAI can find a way to make chatgpt replies easy to filter out.
评论 #34088316 未加载
评论 #34088485 未加载
评论 #34088209 未加载
评论 #34096445 未加载
评论 #34094049 未加载
ikealampe200over 2 years ago
Just today I used ChatGPT to help me speed up writing somewhat trivial C Code for a project in an embedded systems class.<p>Prompt: &quot;Generate a tiny PID controller with only a Proportional factor written in C. That takes a rotational input from -360 to 360 degrees. The setpoint in degrees. And returns a motor speed in the range of -255 to 255.&quot;<p>=&gt; Produced a compiling correct result.<p>Later I wanted to know how to communicate between my kernel module and user space program: Prompt: &quot;How do I get a value via character device from my kernel module into my user space c programm?&quot; gave a bunch of answers and digging deeper with Prompt: &quot;Could you provide me with an example of the user space program&quot; gave a compiling and correct answer again.<p>I could have written all of that myself while spending a good amount researching on google. But this way I felt less frustrated and was definitively a lot quicker.<p>Not the solution for everything but maybe for a C beginner where research can take a long time and often leads to more confusion than anything else. Now the question is if that confusion is critical in the learning process. And if so how critical and at what stages of the experience spectrum the most?
评论 #34087567 未加载
评论 #34092306 未加载
jrvarela56over 2 years ago
I just bought a Streamdeck (<a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Elgato-Stream-Deck-Controller-customizable&#x2F;dp&#x2F;B06XKNZT1P" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Elgato-Stream-Deck-Controller-customi...</a>) for Cybermonday and attached bash scripts similar to those mentioned by the author to buttons next to my keyboard. It is delightful.
评论 #34087573 未加载
评论 #34087253 未加载
评论 #34087977 未加载
评论 #34087575 未加载
solarkraftover 2 years ago
&gt; But it fucking sucks. Like, it’s truly awful to write<p>I feel like I&#x27;m the only person among my peers to think this and I don&#x27;t understand why.
评论 #34088649 未加载
评论 #34090803 未加载
xliiover 2 years ago
On the other hand I’ve had vastly different experience.<p>Every single time I went to GPT and ask for anything development related I came back empty handed after being send for the goose chase.<p>An example of this would be when I asked fswatch to emit one faux event preemptively and it insisted to use “-1” instead (which quits after one event).<p>I had few instances for more obscure problems where GPT would actually create something I’d call parallel universe of the API. It felt good but such API never existed. Those problems were in JS, Ruby, Shellscript and Elixir.<p>One of the worst answer I was given was actually really buggy implementation of input controlled debounce function. It seemed correct when running but in reality it wasn’t debouncing but ignoring the output on debounce call.<p>So yeah, I don’t think I’ll be using GPT for that soon, but it works quite well as a rubber duck equivalent. By proposing dumb solutions I gather my thoughts better. Not sure if that’s something I’d pay for (yet I’d pay for text generating capabilities)<p>Edit: denounce -&gt; debounce, because autocorrect
guitesover 2 years ago
This is a great example of how someone with little programming knowledge could leverage an AI into building simple scripts.<p>Lately I&#x27;ve been encouraging my friends into trying just that.<p>If the poster would want, for example, to save all current tabs when switching context (going from dev to marketing, for example), this would quickly turn into a more involved debugging&#x2F;prompting question.
评论 #34087134 未加载
generalizationsover 2 years ago
ChatGPT 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.<p>&gt; But [Bash] fucking sucks. Like, it’s truly awful to write [...]<p>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&#x27;t actually try and use it - until you do, and discover it wasn&#x27;t actually that bad. The hardest part was just discovering the incantations for interacting with Chrome - which was a fantastic demo of the power of ChatGPT.
评论 #34087120 未加载
评论 #34087356 未加载
评论 #34087156 未加载
评论 #34087330 未加载
评论 #34087063 未加载
raverbashingover 2 years ago
So the author complains about bash, but uses zsh<p>They also basically uses the chrome cmdline commands and blames bash for that being bad<p>Your problem doesn&#x27;t seem to actually be bash (but chatgpt really makes it super easy)
john2xover 2 years ago
It&#x27;s semi-replaced Google and StackOverflow for me. It&#x27;s like having an interactive rubber duck <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rubber_duck_debugging" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rubber_duck_debugging</a>
评论 #34086922 未加载
mozmanover 2 years ago
I find bash to be pretty awesome, it’s super easy for an old hat like me to use. It just works and it has been mostly unchanged, two core principles more projects should consider.
63over 2 years ago
This is a relatively common use case for browsers that&#x27;s usually solved by tab groups. I&#x27;m happy the author learned bash and leveraged new tools to solve the problem, but it&#x27;s a little over engineered.
lossoloover 2 years ago
I&#x27;ve been using it more and more at work, and it&#x27;s already saved me hours by generating bash commands and simple scripts&#x2F;servers that I would otherwise have to search for on Google and adjust to my specific use case from multiple sources. Thanks to this tool, I have more time to focus on difficult and business-related problems. If they start charging for it, I will definitely become a paying customer. This is an excellent tool that is making me more productive, and I was a big skeptic about how LLMs work internally. Remove hallucination problem, add annotations with links to sources and this is how Google will look like in a few years. IMO this is how future of knowledge search will look like on the internet.
ramozover 2 years ago
Wow, yea, I&#x27;ve have the exact same experience with bash.<p>&quot;im using mac, not linux&quot; is an often prompt I need to use, but otherwise this type of flow works great for simple bash functions.<p>For more advanced scripts, prompting &amp; careful flow are important, but I&#x27;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 &amp; their files into the desired tar file size. Eg. &quot;need single tar files of all the data in that folder&#x2F;subfolder, every tar file must be 50GB, most files range from 4MB-1GB. So, need to aggregate them&quot;
civopsecover 2 years ago
&gt; Bash is available everywhere<p>When you have AI but you don’t have permission to use a package manager.
SpencerMLevittover 2 years ago
This is an awesome walkthrough and gets me thinking about all the other automation tasks I could get done with ChatGPT-driven bash scripts... can take this same approach to context switching for actual apps. For ex: &quot;dev&quot; branch can open up vscode, terminal windows, linear, server logs, etc, while &quot;marketing&quot; branch can open up slack, chrome (to email), twitter, notion, etc
评论 #34087118 未加载
user3939382over 2 years ago
I was just commenting to a friend how annoying it is that macOS aliases can&#x27;t add flags to executables like you can easily do in Windows shortcuts since, what? Windows 95?<p>If you want to launch Chrome with flags through your dock&#x2F;UI you have to compile an AppleScript to an .app. It&#x27;s crazy.
评论 #34087325 未加载
cervedover 2 years ago
The problem you describe is how to interface with Google chrome on osx using shell script.<p>I fail to see a single bashism.
评论 #34087883 未加载
albert_eover 2 years ago
I am very excited to see this being integrated with a lot of productivity tools -- removing the need for manually copy-pasting the ChatGPT output into various other apps like VS Code or Excel :)<p>&quot;Create a new Python project folder named &#x27;hello-openapi&#x27; and initate a git repo. Create a requirements.txt with openai, os and json. Create a starter python file with an openai example code and make the first commit.&quot;
alecfongover 2 years ago
I find it interesting how much harder it is to grok bash&#x2F;sh&#x2F;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.<p>Gpt does seem to unblock this mental burden a bit which has me excited for its potential when it comes to education&#x2F;teaching.
评论 #34087304 未加载
_jayhack_over 2 years ago
Try LLM.sh - GPT-3 in your terminal<p><a href="https:&#x2F;&#x2F;github.com&#x2F;jayhack&#x2F;llm.sh">https:&#x2F;&#x2F;github.com&#x2F;jayhack&#x2F;llm.sh</a><p>Type `llm [natural language command]` and it will suggest a command for you, then run it.<p>Details here: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;mathemagic1an&#x2F;status&#x2F;1590480438258462721" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;mathemagic1an&#x2F;status&#x2F;1590480438258462721</a>
jrochkind1over 2 years ago
I&#x27;m pretty damn impressed with this one. The osa-script thing for Mac even, wow.
waynesonfireover 2 years ago
yeah, game changer. it&#x27;s deprecated having to click on links for common use-cases and not only that, it&#x27;s improved it by more than 10x. can&#x27;t wait to see this technology evolve.
评论 #34087078 未加载
tottenvalover 2 years ago
Github Copilot can do this too.
评论 #34087068 未加载
olalondeover 2 years ago
I don&#x27;t understand how people can look at this and still claim that it&#x27;s not doing any &quot;actual reasoning&quot;.
评论 #34087288 未加载
评论 #34087173 未加载
评论 #34087070 未加载
评论 #34087882 未加载
评论 #34087547 未加载
评论 #34087150 未加载
评论 #34088294 未加载
评论 #34091335 未加载
评论 #34088700 未加载
评论 #34087696 未加载
sureglymopover 2 years ago
Since when is back awful to write? I live writing bash :(
timwisover 2 years ago
I’ve been waiting for ChatGPT to be “available” for weeks now (it was too busy before). How have so many people been able to use it?
bulldog13over 2 years ago
Can anyone recommend some more articles about this ? Specifically, using chatgpt to write code? The more in depth, the better.
评论 #34089104 未加载
评论 #34088708 未加载
评论 #34087851 未加载
secondcomingover 2 years ago
We&#x27;re all doomed. This is going to ruin everything. Everyone&#x27;s job will turn into debugging AI generated code.
评论 #34089677 未加载
an_aparallelover 2 years ago
i will take a chance anywhere i can to just say it&#x27;s a crying shame how useful this is - but also how crap it is that it requires use to be linked to your identity...