Live data from Hacker News

Start all of your commands with a comma (2009)

rhodesmill.org

171–177 of 177 posts

Re: Start all of your commands with a comma (2009)

#171

Earlier quoted context omitted.

what doesn't work about it? i made ",foo.bar" and i went into PS and typed , and it said: > PS V:\> & '.\,foo.bar'

The goal is to have short aliases. That explicit call syntax isn't exactly convenient. That's what doesn't work.

i typed a literal comma, and then the tab button, and it put in the baker's dozen other characters. I only did this to see if "this doesn't work in powershell" was true, turns out it is not true.

if i have ,foo.exe and ,cuda_install.exe in a directory (or on my path), it's two characters and then a tab, same as linux, to run either of them: ,c || ,f

anyhow, it was for my own edification.

Re: Start all of your commands with a comma (2009)

#172
post #78

Earlier quoted context omitted.

Fair point. I've been doing this for years and none of my scripts have ever caused any (noticeable) breakage, though. The danger is also mitigated because I only modify my own user's shell rc file. Any daemons running as root or their own user are unaffected.

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.

> causing exactly this sort of issues

POTENTIALLY. This (for me, anyway), is a solution in search of a problem. Been using some sort of *nix since the early 90's, writing scripts and commands and aliases and functions the whole time - this has never once happened to me.

It obviously _can_, and PROBABLY has, to some. But it's more a "can" than "will". Maybe I just name my homebrew stuff in a way that's unlikely to collide, dunno.

Re: Start all of your commands with a comma (2009)

#173

I use different namespaces for different convenience scripts, and use the notation [character].[command] for all of them. I've used a character for each company I've worked for, and a different one for common scripts. This way is very easy to clean $HOME when I move.

I like the idea of using periods for collections of commands. I have a todo list hacked together with shell scripts and I've been thinking about how I might want to stay away from collisions. I think I'll use do.thing style commands, so my commands will be: do.item Add an item to the bottom of my todo list do.soon List the items that I need to do soon do.next List the next item to work on do.mark Mark the current ite…

I liked the idea of this but it won't work for me in practice. A down-side of periods is that you can't use them in an `alias`. Since that is how I configure a lot of these commands the period is probably not an option I can use consistently.

Re: Start all of your commands with a comma (2009)

#174
post #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`.

But then you start using some tool that expects $0 in the system path and breaks causing frustration and debugging. Pick your poison

I put ~/bin/ at the start of my path as well. It works very well for me, but I also have to admit that I've never experienced a name collision from doing this as far as I'm aware.

I'm not on the comma train here because it makes the name ugly and confusing, and doesn't solve any problem that I have. But it is a clever hack for those who do have this problem.

Re: Start all of your commands with a comma (2009)

#175

Earlier quoted context omitted.

Commaands? I liike it

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"

And just for compl&eness the symbol "&" is called an ampersand.

Re: Start all of your commands with a comma (2009)

#176

Earlier quoted context omitted.

The pun still holds as "comma,nds" though, and might even do so better.

Oh, I thought the user was suggesting using just ",nds" instead of "comma,nds". That makes more sense.

Oh, they might have been. The joke might have gone completely over my head when I said that! Still though, it sounds like "comma,nds" would be a good compromise either way.
Post reply on HN