Start all of your commands with a comma (2009)
11–20 of 177 posts
Re: Start all of your commands with a comma (2009)
#12Not sure I understand this problem. I just put my bin directory at the front of $PATH rather than the end. To browse my commands, I simply `ls ~/bin`.
Re: Start all of your commands with a comma (2009)
#13I usually do the same with commands where you are able to create sub-commands too, like git-,home (which allows you to run `git ,home add -p` and it conveniently set GIT_DIR to something and GIT_WORKTREE to $HOME). Sadly you can't do it with git aliases, I have to live with them starting with a dot (via '[alias ""]' as a section).
Re: Start all of your commands with a comma (2009)
#14Re: Start all of your commands with a comma (2009)
#15- is your ~/bin directory a git repo?
- if you git to manage your dot files, do you use hard links or soft links?
Re: Start all of your commands with a comma (2009)
#16Funny. My ~/bin is filled with commands that I want to override the system version.
Re: Start all of your commands with a comma (2009)
#17I use short custom command names like aa, st, di, dp, cm and le in some thin wrappers around git. One of these names actually collides with a utility that is installed by default on some systems. Doesn’t matter to me. I have my own bin dirs before the system dirs in my path, so mine “win”, and I’m not really interested at all in the tool that mine has a name collision with. If someone were to make a useful to me tool…
This. 1-3 character names should be reserved for user aliases/functions/scripts and standard utilities.
Re: Start all of your commands with a comma (2009)
#18I use Windows most of time. Like the author, I have bunch of CLI scripts (in Python mainly) which I put into my ~/bin/ equivalent.
After setting python.exe as the default program for `.py` extension, and adding `.py` to `%pathext%`, I can now run my ~/bin/hello.py script at any path by just type `hello`, which I use hundreds of time a day.
I now use Linux more and more (still a newbie) but I never get it to work similarly here.
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`?).
Furthermore, I failed to find any way to omit `.py` part when calling my script.
Again, none of the above is to question the design of the Linux -- I know it comes with lots of advantages.
But I really, really just want to run `hello` to call a `hello.py` script that is in my $PATH.
Re: Start all of your commands with a comma (2009)
#19> Because my shell script names tended to be short and pithy collections of lowercase characters, just like the default system commands, there was no telling when Linux would add a new command that would happen to have the same name as one of mine. Not sure I understand this problem. I just put my bin directory at the front of $PATH rather than the end. To browse my commands, I simply `ls ~/bin`.
Pick your poison
Re: Start all of your commands with a comma (2009)
#20> Because my shell script names tended to be short and pithy collections of lowercase characters, just like the default system commands, there was no telling when Linux would add a new command that would happen to have the same name as one of mine. Not sure I understand this problem. I just put my bin directory at the front of $PATH rather than the end. To browse my commands, I simply `ls ~/bin`.