5 ms·
I have been using ChatGPT for generating these kind of small CLI like this. My prompts look like this: - use jq to count a nested array "a.b.c.d" - fin
by thangngoc89 3y ago
I have been using ChatGPT for generating these kind of small CLI like this. My prompts look like this:
- use jq to count a nested array "a.b.c.d"
- find and delete empty folders using `find`
- find and replace text using sed/awk
I found that using ChatGPT for these purposes boosted my productivity tremendously.
- deleted 3y ago[deleted]
- dotancohen 3y agoChatGPT is a great time saver for those who already know how to use awk. But it should not be used by those who are unfamiliar. Just an example, I saw someone come up with a great awk line to change some text in a nested directory. He then pasted into bash. Only once the server went down did anybody realize that he forgot to cd into the proper directory and he wiped out not only the server config but also all the user-uploaded data as well. The server config was not version controlled and the user data had not been backed up in almost a week.
- swores 3y agoThat's not really a ChatGPT issue, people pasting in slightly wrong commands (or right commands in the wrong folder) is a tale as old as time - well, as old as linux at least. Short of saying that nobody who's already an expert should ever touch a CLI, the lesson from that story is "be as careful as possible, then be more careful, and also have backups of everything" not "don't use a LLM to help".
- simonw 3y agoYeah, that exact same problem could easily affect someone who spent hours cobbling together the same awk script from Google searches and StackOverflow.
- mistercheph 3y agoWhat “care” do you suggesst that someone pasting in a script they don’t understand should take?
- swores 3y agoI'm far from an expert so you should probably ask someone other than me. But my two cents would be not to paste any code until you have understood it, or unless it's written by a source you trust, or alternatively only paste it somewhere you don't care - when I'm playing around testing stuff I might not fully understand on a linux server I do it on a VPS that's unimportant to me, and that if I mess it up I can very easily restore it back to a clean OS install and I have a bash script ready to reinstall all software I want & all the profile customisations etc.
- simonw 3y agoMy usages of tools like awk, sed and Bash scripting has increased an enormous amount thanks to ChatGPT/GPT-4. I'm using those on a weekly basis now, because I don't have to memorize details of entirely new programming languages in order to apply them to small problems. Smaller languages that I never took the time to learn are no longer something I avoid. I even use AppleScript now! https://til.simonwillison.net/gpt3/chatgpt-applescript https://til.simonwillison.net/gpt3/chatgpt-applescript