Live data from Hacker News

Start all of your commands with a comma (2009)

rhodesmill.org

131–140 of 252 posts

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

#131
post #94
post #92

Earlier quoted context omitted.

Oh, that might be true, I do remember encountering some escaping issues when creating a more complex POSIX (or bash) script that involved lists and iterating through stuff. I see Bash only uses commas in Brace expansions: file{1,2,3}.txt # file1.txt file2.txt file3.txt I guess it would only be a problem if you want to expand file,.txt file,,.txt file,,,.txt

Imagine seeing this code: echo file{",",",,",",,,"}.txt

Ah, I see you're a man of culture as well!

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

#133
post #27

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

People tend to want some separation between what's theirs and what's others. Other programs/scripts quite often put something into ~/.local/bin, so it's not yours actually, it's theirs.

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

#134

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…

> I prefer giving scripts numbers instead of names

> Something like "[number"

> It contains 100s of short scripts

So you call scripts like [1 [2 [3 [4 ... and remember what each one of them does? If yes - that's nuts, I'd visit a doctor.

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

#135
post #19

Most of my aliases contain `--` for the same reason, `git--progress`, `grep--rIn`, `nvidia--kill`, `ollama--restart`, `rsync--cp`, `pdf--nup`... Easy autocomplete, I know there won't be any collision, and which command is mine.

Kinda makes no sense to me: so you don't use '--' as a prefix, you use it in the middle of an alias, so you first have to autocomplete, say, 'gi' not to 'git' but to 'git--progress'. What does that alias do? Doesn't it call git with some args? If so - why not just alias it to git?

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

#136

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.

Might I ask exactly what the typo was?

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

#139
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.

You could also do this sort of thing with XCompose, yes?

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

#140
post #128

There’s this program on nix that lets you type a comma, then any application name that exists anywhere in the Nix repos. It then downloads that app and runs it once, without “installing” it. Sometimes I find myself running something dozens of times this way before I realize it should probably be in my config.

https://github.com/nix-community/comma
Post reply on HN