Clever trick. Too bad there's no good way to namespace commands. It would be interesting if you could have, for instance: $ mkdir -p /tmp/bin/my $ printf '%s\n%s\n' '#!/bin/sh' 'echo hello' > /tmp/bin/my/hello $ chmod 755 /tmp/bin/my/hello $ PATH="/tmp/bin:$PATH" $ my/hello hello
Ahem, technically there is one way (don't know if it is "good", though):
My keyboard came with a tab key, so I don't worry about my commands having short names.
Until you have five commands which all use the prefix `sort-incoming-` and then three commands named `sort-incoming-hourly` and `sort-incoming-monthly` etc.
It would be nice to have camel-case completion in the shell, i.e. have “SIH” be completed to “SortIncomingHourly” and “SIM” to “SortIncomingMonthly”, etc. (only for upper-case characters). That way one could get more mileage out of the possible character combinations.
Clever trick. Too bad there's no good way to namespace commands. It would be interesting if you could have, for instance: $ mkdir -p /tmp/bin/my $ printf '%s\n%s\n' '#!/bin/sh' 'echo hello' > /tmp/bin/my/hello $ chmod 755 /tmp/bin/my/hello $ PATH="/tmp/bin:$PATH" $ my/hello hello
You could (ab)use home directories for that. I.e. place your hello into /home/my, and then you can invoke it as ~my/hello. You even get namespace completion for free after the `~`.
Reposts are ok after a year or so. This is in the FAQ: https://news.ycombinator.com/newsfaq.html . Could you please review the site guidelines at https://news.ycombinator.com/newsguidelines.html and stick to them? Your last sentence there breaks more than one of the rules.
Again, to reiterate, the original comment was not a statement that this should not have been reposted. I am not sure how I could make that clearer? I have read the site guidelines. Many of them are subjective and inconsistent with unknown applicability. If you, as the administrator, are unable to accept that evaluation, then please just delete this account and all associated posts.
I've never once had a problem with one of my commands shadowing a system command so I think I will continue on rather than solving this non-problem, thanks.
This brought https://github.com/Shopify/comma to mind
Do you know any of the history of why your link to `.../Shopify/...` redirects to `.../nix-community/...`? Is the latter an open-source contribution by Shopify?
It can if you are executing programs that then try to execute those commands and get your commands instead.
I wish it was easier to create "snapshots" of a particular set of environment variables in order to use them later as run environments. I also wish that Unix desktop environments generally made it easier to manage env vars, but that's another complaint. And don't get me started on PAM env vars...
I have used a similar windows trick. I wanted to add to the default window system a place for my library of tools. Most are "portable" cmd apps from various sources (sysinternals, nirsoft). I put them all into a directory called ] in the root of a drive. Because of some common layout of keyboards the \ and ] are near each other, or in reach of left and right pinkies I can type \]\ before the name of the tools. This m…
I put c:\tools in my path, then put shortcuts to all my tools in there (ie: shortcut to AgentRansack named ar).
Now, I pull up the run command (WND+R) type ar and agent ransack opens.