Top
Best
New

Posted by theblazehen 2 days ago

Start all of your commands with a comma (2009)(rhodesmill.org)
377 points | 134 commentspage 4
gugod 6 hours ago|
I tried a variant or this idea so many years ago after I leaned git and rearranged some of my personal tools as subcommands (like git) of a single executable named "dude,"

It went weird pretty quickly...

renewiltord 37 minutes ago||

    dude, whois my.car
eMPee584 2 hours ago||
.. examples?
feelamee 5 hours ago||
can someone explain security consideration of placing scripts into $HOME? Some time ago I moved all my scripts to /usr/local/bin, because I feel that this is better from security perspective.
Galanwe 5 hours ago||
There are no security implications, on the contrary.

It is objectively cleaner to keep your user scripts in your home, that way they are only in _your_ PATH, whereas putting them in /usr/[local/]bin implicitly adds them to every [service] user on the machine, which I can see creating obscure undesired effets.

Not even mentioning the potential issues with packages that could override your scripts at install, unexpected shadowing of service binaries, setuid security implications, etc.

layer8 4 hours ago||
Someone with access to your home dir can also set your $PATH and aliases to anything they want, so I don’t see any extra security considerations here.
ndsipa_pomu 6 hours ago||
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 meaning somewhere and including it as the first character in a filename looks wrong. (e.g. Comma is typically used as a list separator and it's a bit of cognitive dissonance to see it not used in that context)

layer8 3 hours ago||
Underscore requires pressing Shift, however.

> I don't like the idea of a punctuation prefix as punctuation usually has a specific meaning somewhere and including it as the first character in a filename looks wrong.

So you don’t use dotfiles? ;)

ndsipa_pomu 3 hours ago||
Well dotfiles demonstrate that punctuation can have a special meaning in filenames.

I'm not convinced by "quicker to type" arguments as that's rarely the bottleneck, so I'm perfectly happy with using underscores in filenames and variables. I wouldn't use underscore as the beginning character of a filename unless it had a specific meaning to me (e.g. temporary files), so I'd be more inclined to use a two or three character prefix instead.

layer8 3 hours ago||
For me it’s not about quickness, but about strain. Like in RSI.
eterps 6 hours ago||
I use my_ as a prefix.
k3vinw 2 hours ago|||
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 “.”

ndsipa_pomu 51 seconds ago||
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.
ndsipa_pomu 4 hours ago||||
I used to use "do" as a prefix e.g. "doBackup"

Nowadays, I tend to skip using a personal prefix and just try to name commands with a suitable verb in front (e.g. "backupMySQL") and ensure that there's no name collisions.

JamesTRexx 5 hours ago|||
Whenever I see "my" as a prefix, it feels like such a childish "my first Sony" thing. I hate official sites using that.
SoftTalker 43 minutes ago||
This was actually the same feeling I had when I tried to learn perl. I just had a visceral dislike for "my" as the keyword to declare a local variable.
laughing_snyder 5 hours ago||
> Like many Unix users, I long ago created a ~/bin/ directory in my home directory

`.local/bin` seems to be much more common in my experience for this use case. And for good reason.

Levitating 5 hours ago||
~/bin is actually created per default on OpenSUSE (though it's removal has been discussed several times).
zhouzhao 5 hours ago||
Unclutter your $HOME!
luplex 6 hours ago||
similarly, I start all my underscorends with an underscore
bronlund 6 hours ago||
This is just brilliant. Thanks.
guilherme-puida 6 hours ago||
(2009)
HelloUsername 6 hours ago|
Previous discussions:

2024: https://news.ycombinator.com/item?id=40769362

2022: https://news.ycombinator.com/item?id=31846902

2020: https://news.ycombinator.com/item?id=22778988

yunohn 5 hours ago||
I read this blog a few years ago, and implemented it soon after with a refresh of my rc files and shortcuts. Gamechanger - has helped me every single day since. It’s easy to remember, autocompletes easily, and adds a little flair of personalization.