Start all of your commands with a comma (2009)
91–100 of 252 posts
Re: Start all of your commands with a comma (2009)
#92Earlier quoted context omitted.
What about using the filename in arrays in bash/sh?
But Bash arrays don’t use comma, what’s the problem?
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,,,.txtRe: Start all of your commands with a comma (2009)
#93Using 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.
Re: Start all of your commands with a comma (2009)
#94Earlier quoted context omitted.
But Bash arrays don’t use comma, what’s the problem?
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
echo file{",",",,",",,,"}.txtRe: Start all of your commands with a comma (2009)
#95Re: Start all of your commands with a comma (2009)
#96Why so many people use ~/bin/? What’s wrong with ~/.local/bin?
(Anything that modifies standard behaviour is not in PATH, but instead a shell function present only in interactive shells, so as not to break scripts.)
Unix lore: Early unix had two-letter names for most common names to make them easy to type on crappy terminals, but no one* letter command names because the easier were reserved for personal use.
Re: Start all of your commands with a comma (2009)
#97Why so many people use ~/bin/? What’s wrong with ~/.local/bin?
It kind of goes against the idea why dotfiles are dot-prefixed.
Re: Start all of your commands with a comma (2009)
#98I 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? ;)
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.
Re: Start all of your commands with a comma (2009)
#99Why so many people use ~/bin/? What’s wrong with ~/.local/bin?
Re: Start all of your commands with a comma (2009)
#100I 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…
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 neatest thing around, it works surprisingly well.
Another idea which looks useless until you start using is text expanders (i.e.: Espanso and TextExpander).