Live data from Hacker News

Start all of your commands with a comma (2009)

rhodesmill.org

81–90 of 252 posts

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

#82
post #52

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…

Just on your first suggestion, this also means that if a person or process can drop a file (unknown to you) into your ~/bin/ then they can wreak havoc. Eg they can override `sudo` to capture your password, or override `rm` to send your files somewhere interesting, and so on. Btw on the second suggestion, I think there's a command named `command` that can help with that sort of thing, avoids recursive pitfalls.

I think it's already game over if they have access to your home directory. They can also edit your path at that point.

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

#83

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.

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.

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

#84

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…

curious if you're customizing anyway, why not use eg ripgrep?

repgrep's CLI options and general behavior are different from grep. I tend to use both for different things.

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

#85
post #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…

Its some what natural to german spkrs who use a special set of double quotes to start a quote in print.

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

#86
post #51

Using commas in filenames feels kind of weird to me, but I do use a comma as the initiator for my Bash key sequences. For example: ,, expands to $ ,h expands to --help ,v expands to --version ,s prefixes sudo You put keyseqs in ~/.inputc, set a keyseq-timeout, and it just works.

would an alias just work in this use-case?

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

#87

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…

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? ;)

Post reply on HN