Live data from Hacker News

Start all of your commands with a comma (2009)

rhodesmill.org

41–50 of 252 posts

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

#41
post #13

I appreciate the idea, but the comma just looks horrible to me as part of a filename. I can imagine someone unfamiliar with the naming scheme to get confused. I'd prefer to use underscore (when writing BASH scripts, I name all my local variables starting with underscore), but a simple two or three letter prefix would also work. I don't like the idea of a punctuation prefix as punctuation usually has a specific meanin…

I use my_ as a prefix.

Whenever I see "my" as a prefix, it feels like such a childish "my first Sony" thing. I hate official sites using that.

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

#43
Nice although I think the ASCII comma feels wrong as part of a filename even if for purely aesthetic reasons.

If we want to stay within (lowercase) alphabetic Latin characters I think prefixing with the least common letters or bigrams that start a word (x, q, y, z, j) is best.

`y' for instance only autocompletes to `yes' and `ypdomainname' on my path.

Choosing a unique bigram is actually quite easy and a fun exercise.

And we can always use uppercase Latin letters since commands very rarely use never mind start with those.

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

#48
post #24
post #2

This is one of those ideas that is so simple and elegant that it makes you think “why did I never think of doing this?!” Neat trick! I don’t think I’ll namespace everything this way, because there’s some aliases and commands I run so often that the comma would get annoying, but for other less frequently used helper scripts then this will be perfect!

I do something similar with build trees, naming them +build, +cross-arm etc. This convention was suggested by the GNU Arch version control system years ago (maybe 20??), but it's really useful for the same tab completion reason and I have kept it for almost two decades, even when I switched to git.

It was suggested by Tom Lord (RIP), who used it heavily long before he wrote GNU Arch.

File names or directories starting with a comma where considered “junk”, and ones with a plus sign I think where considered “precious”.

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

#49
post #25

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…

> If I introduce an executable with a name, that overrides a system one ... and breaks existing scripts that reference the system one, right?

Not if it is an alias.

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

#50

I use a different prefix character, e.g. "[", but I have been doing this for years I started using a prefix because I like very short script names that are easy to type I prefer giving scripts numbers instead of names Something like "[number" I use prefixes and suffixes to group related scripts together, e.g., scripts that run other scripts I have an executable directory like ~/bin but it's not called bin. It contain…

do you publish dotfiles and scripts anywhere? I'm interested to see them
Post reply on HN