Live data from Hacker News

Start all of your commands with a comma (2009)

rhodesmill.org

161–170 of 252 posts

Re: Start all of your commands with a comma (2009)

#161

Tangentially related. Don't ever put "." in your PATH. I used to do this to avoid typing the "./" to execute something in my current directory. BAD IDEA. It can turn a typo into a fork bomb. I took down a production server trying to save typing two characters.

It used to be very common to "own" a unix system by adding a `ls` binary in some folder and waiting for an administrator to run it.

Re: Start all of your commands with a comma (2009)

#162
post #129
post #13

Earlier quoted context omitted.

I use my_ as a prefix.

That’s a more meaningful prefix than “,” at the expense of a couple more key strokes. I consider that to still be a win in the book of tab completions. I would replace underscore with “-“ or “.”

I'd warn against creating files starting with "-" as that can lead to unexpected results with tools if you forget to use "--" to end options. Nothing wrong with using "my-" as a prefix though.

Re: Start all of your commands with a comma (2009)

#165
post #164

Why not just start every alias or script with ë or something?

Comma is easier to type and less visually distracting

makes sense, article mentions not wanting composite keys. There goes my sarcasm.

However, I'd advocate for an ë key then.

Re: Start all of your commands with a comma (2009)

#166
post #27

Why so many people use ~/bin/? What’s wrong with ~/.local/bin?

Random things are installed in ~/.local/bin. In ~/bin I have only what I put there.

Python and rust (for example) package managers install user wide tools there.

Re: Start all of your commands with a comma (2009)

#167

I didn't like the idea. I prefer the alternative approach: _I_ decide the order of dirs in the PATH env. If I introduce an executable with a name, that overrides a system one - I probably do that intentionally. If I introduce an alias (like `grep='grep --binary-files=without-match --ignore-case --color=auto`) that matches the name of a system binary - I probably do that intentionally. And if I EVER need to call grep…

Looked so backwards to me, too. However, I decided to give it a go, anyway. Now, I have some scripts and small commands which start with a comma, and it looks neat and time saving. Yes, I can do path ordering to override usual commands. However, having a set of odd-job scripts which start with a comma gives a nice namespacing capability alongside a well narrowed-down tab-completion experience. While it's not the neat…

The irony in the number of extra commas you've used in this comment...

Re: Start all of your commands with a comma (2009)

#168

instead of using ~/bin I use ~/installed/bin, sometimes I need build a command from source then install it, which might have share/ man/ etc so I can avoid installing them under the home dir.

~/.local/ could work for this, and as another user mentioned easier to separate the back up.

Re: Start all of your commands with a comma (2009)

#170
post #148

Earlier quoted context omitted.

https://github.com/nix-community/comma

I'm not sure I'll ever understand why they replaced their working ~50 line shell script with a Rust program that just shells out to the same nix-* commands. I appreciate that there are some safety benefits, but that program is just not complex enough to benefit.

Because it's "a proper language" [1]. Not to mention webscale!

It does seem to do some more complex stuff now that would've been annoying, but not impossible, to write as a shell script.

[1]: https://github.com/nix-community/comma/pull/19

Post reply on HN