Top
Best
New

Posted by zdw 1 day ago

Shell Tricks That Make Life Easier (and Save Your Sanity)(blog.hofstede.it)
526 points | 239 commentspage 6
keybored 15 hours ago|
> We’ve all been there.

Close tab.

I ought to migrate away from shell scripting and just keep the shell for interactive use. Unfortunately I have cursed myself by getting competent-ish with P. shell and Bash scripting. Meaning I end up creating maintenance headaches for my future self.

(Echoes of future self: ... so I asked an LLM to migrate my shell scripts to Rust and)

Anyway with the interactive shell stuff. Yeah the I guess Readline features are great. And beyond that I can use the shortcut to open the current line in an editor and get that last mile of interactivity when I want it. I don’t really think I need more than that?

I tried Vim mode in Bash but there didn’t seem to be a mode indicator anywhere. So dropped that.

Edit: I just tested in my Starship.rs terminal: `set -o vi`. Then I got mode indicators. Just with a little lag.

joombaga 13 hours ago|
You can use `set vi-ins-mode-string` and `set vi-cmd-mode-string` in .inputrc to get indicators in readline, and you can add them to your prompt with a bit more work: https://superuser.com/questions/1466222/move-vi-mode-string-...
quijoteuniv 16 hours ago||
Guilty as charged
amelius 16 hours ago||
What I hate is that if you start a command with a space it is not recorded in the history. This happens often when copy+pasting commands. I know you can turn it off but still ... this drives me mad.
frou_dh 14 hours ago|
AFAIK that setting is opt-in, at least in Bash.
joombaga 13 hours ago||
Yeah but some operating systems have HISTIGNORE in (or sourced from) their skeleton files.
faangguyindia 17 hours ago|
I just open, agent in tui, and ask it to do what I want and make a plan, i read the plan edit it and run it.

Simple, no need to learn any commandline these days.

I used to use arch and all, and managed many big projects. I find little value in learning new tools anymore, just feed it docs and it generated working plan most of the time

Now I've moved to coding in Haskell, which i find suits me better than wasting my time with cli and exploring what options all these cli tools have.

chriswarbo 15 hours ago||
I'm confused; how is writing a shell command (using shortcuts like those in the article!) "wasting time", but describing what you want to an LLM, having it make a plan, reading the plan, editing it, and running it is somehow not a waste of time?

You also mention there being "little value", when your proposed approach costs literal money in form of API/token usage (when using hosted models).

> Now I've moved to coding in Haskell

You might like https://hackage.haskell.org/package/turtle or http://nellardo.com/lang/haskell/hash/

worksonmine 16 hours ago||
What is it like to be this proud of not learning the tools you use? Do you really think several paragraphs to an agent that may or may not be correct is the "easy" way compared to just checking the manual for the flag you want?

I will never understand people like you.

faangguyindia 15 hours ago||
Tools are means to end.

They don't matter much to me.

bigstrat2003 2 hours ago||
That's fine to a point. But if you don't learn your tools, you will have rendered yourself unable to catch when the LLM gets things wrong (and it will get things wrong because it doesn't understand anything it touches). That, in turn, will mean that you're going to struggle to reach your desired ends but won't have the understanding to figure out what's wrong.

"Tools are just a means to an end" means you need to not get attached to a tool if it's not doing the job. It doesn't mean you don't need to understand your tools.