![]() |
|
![]() |
| I think "comma_nds" ("commands" if you remove the underscore) makes the pun mkre obvious.
I didn't get it at first thought, thinking of the .nds file extension for Nintendo DS ROMs. |
![]() |
| Article is from 2009. Plenty of prevalent short named tools have been released since then, causing exactly this sort of issues. Just thinking about it, "node" and "npm" come to mind. |
![]() |
| The “ls “ part is not necessary for tab completion.
Is enough. Not that short, but is something done infrequently in my experience. Maybe I’d do it more if it was easier? |
![]() |
| All my personal commands begin with 'j'. Got real fun when java came around. Using commas is a rather interesting idea.
But at least I did not start them with a 'k' (KDE) :) |
![]() |
| > then you have to add a shebang line directly to the script itself, which I always feel uncomfortable since it's hard-coded (what if in future I don't want to execute my .py script with `/usr/bin/python` but `/usr/bin/nohtyp`?)
> But I really, really just want to run `hello` to call a `hello.py` script that is in my $PATH. On Linux I'd say the shebang is still the right tool for this. If you want a lightweight approach, just have a `my_python` symlink in your path, then your shebang can be `/usr/bin/env my_python` (or heck just `/foo/bar/baz/my_python`, /usr/bin/env is already an abstraction). If you want a more principled approach, look at the `update-alternatives` tool, which provides this sort of abstraction in a more general way: https://linuxconfig.org/how-to-set-default-programs-using-up... |
![]() |
| > but then you have to add a shebang line directly to the script itself, which I always feel uncomfortable since it's hard-coded
It won’t directly help reach your goal, but it is semi hard-coded. The ‘correct’ (but see https://unix.stackexchange.com/a/29620 for some caveats) way to write a shebang line is
That will make it run the first python in your path.> what if in future I don't want to execute my .py script with `/usr/bin/python` but `/usr/bin/nohtyp`?). You could create a symlink called python to /usr/bin/nohtyp on your system in a directory that’s searched before /usr/bin (e.g. by adding ~/myCommandPreferences to the front of your PATH) |
![]() |
| I think at this point we can rest easy that python2 has finally been fully purged from default installs. Heck a few weeks ago I installed Kubuntu 24.04 base and there was no Python at all... |
![]() |
| > Firstly, Linux seems to have no concept of "associated program", so you can never "just" call .py file, and let the shell to know to use python to execute it. Sure, you can chmod +x to the script, but then you have to add a shebang line directly to the script itself, which I always feel uncomfortable since it's hard-coded (what if in future I don't want to execute my .py script with `/usr/bin/python` but `/usr/bin/nohtyp`?).
Might be you could use binfmt_misc for that. https://www.kernel.org/doc/html/latest/admin-guide/binfmt-mi... |
![]() |
| You can use the /usr/bin/env python shebang line to work across python location
I keep all my scripts in ~/git/$Project and symlink them into ~/bin and I've added ~/bin to the end of my path. |
![]() |
| I meant specifically that you can quickly see all your custom scripts (and only them) by tab-completing comma itself. Of course aliases have regular tab completion in bash as well. |
![]() |
| > I'd never (not so far) encounter a word or text that starts with a comma immediately followed by anything.
Agreed. I prefer using `!bang`s for the same reason for expanding text. |
![]() |
| I don't really understand the problem it solves. can't you just put your own bin directory first in the PATH?
I do like the idea of autocompleting your own commands though. |
![]() |
| I'm curious how folks manage their important local configurations, e.g.
- is your ~/bin directory a git repo? - if you git to manage your dot files, do you use hard links or soft links? |
![]() |
| I got this from an old HN comment I can't find anymore. I have this in my .bashrc:
And I init my dotfiles into a fresh home directory like this:
|
![]() |
| I use chezmoi - it handles both elegantly & has no real requirements w.r.t. how you choose to structure your filesystem. It also handles recovery well when you mess things up. |
![]() |
| Similarly, some Lisps (like Scheme48 IIRC) use a comma to begin REPL commands (as distinct from Lisp forms) because commas outside of quasiquotation forms are otherwise syntax errors. |
![]() |
| I like it I think. I'd probably be more inclined to add the comma to the end, that way tabbing on "mount" would bring up "mount and mount," which is your personal one. |
Commaet(s). & is Et, which means "and" in latin. Your read of it reminds me of the old Jack in the Box signage which, according to a good friend, looked like "Jack in the B-Fish"