3 ms·
May be an old-fart prejudice, but my eyes cross to think that 'dash and underline are equivalent' might be a desired thing. Making bash be clever seems like a
by rout39574 11y ago
May be an old-fart prejudice, but my eyes cross to think that 'dash and underline are equivalent' might be a desired thing. Making bash be clever seems like a pile of pitfalls.
To each their own.
- bpchaps 11y agoYeah, I don't get this one, either. This seems far away from sane. What's the rationality behind it?
- mrzool 11y agoI don't have any file or folder name starting with a dash, while underscores are pretty common. Treating dashes and underscores as equivalents saves you one keystroke (i.e. you can type `cd -folder<tab>` instead of `cd _folder<tab>`).
- wyldfire 11y agoYou mean it saves you one edit in the case where you've mistyped the directory name? Otherwise it seems like no keystrokes are saved among the two you show. EDIT: groan, ok, you win. Net -1 keystroke for most keyboards.
- mrzool 11y agoThe shift press doesn't count as keystroke? :)
- jsprogrammer 11y agoMost keyboards only emit an underscore while a shift button is depressed.
- bpchaps 11y agoIs this really the reason? One keystroke? That just borders on bloat... Just put "set -o vi" if you want to remove keystrokes, which this doesn't include.
- mrzool 11y agoI've used `set -o vi` for a while but found that emacs-like keybindings are much, much better for inline editing. And yes, even one keystroke saved matters.
- bpchaps 11y agoOh no, I totally understand - typing this on a happy hacker keyboard ;). I'm just somewhat of a cynic, since my workflow tends to fall on its face when I'm on a server that uses special snowflake rc files. Furthering that cynicism.. these days I'm just using plain /bin/sh for any shell scripts just because of the amazing level of bloat that exists within bash.
- chairleader 11y agoIf you have an inconsistent naming convention in your directory structure, this could speed things up/save some memorization. I'm not a fan of adding features that make poor choices less painful, but I could see using it for a little while as I'm getting to know a non-ideal environment.
- mrzool 11y agoThat's just for tab completion, not overall. I agree that that would be far from sane.