Live data from Hacker News

Start all of your commands with a comma (2009)

rhodesmill.org

71–80 of 252 posts

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

#71

I didn't like the idea. I prefer the alternative approach: _I_ decide the order of dirs in the PATH env. If I introduce an executable with a name, that overrides a system one - I probably do that intentionally. If I introduce an alias (like `grep='grep --binary-files=without-match --ignore-case --color=auto`) that matches the name of a system binary - I probably do that intentionally. And if I EVER need to call grep…

[deleted]

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

#74
post #64

Earlier quoted context omitted.

I do this, and routinely shadow commands with my own wrappers to do things like set environment variables. And then there’s Claude. It deletes whatever it finds at ~/.local/bin/claude, so I have to use a shell function instead to invoke the full path to my wrapper.

You can use an alias, which takes priority over $PATH. e.g. I have this in .zhsrc to override the "claude" executable to run it in the OS sandbox: alias claude="sandbox-exec -f ~/agents-jail.sb ~/.local/bin/claude --dangerously-skip-permissions"

How does your sandbox ruleset look? I've been using containers on Linux but I don't have a solution for macOS.

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

#76
post #72
post #23

Every tool and shell that lay in arm's reach treated the comma as a perfectly normal and unobjectionable character in a filename. WTF. After 40 years maybe I should have figured that one out.

What about using the filename in arrays in bash/sh?

But Bash arrays don’t use comma, what’s the problem?

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

#77
post #23

Every tool and shell that lay in arm's reach treated the comma as a perfectly normal and unobjectionable character in a filename. WTF. After 40 years maybe I should have figured that one out.

Until someone forces you to use a file system that cannot tolerate commas...

Which file system would that be?

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

#80

I didn't like the idea. I prefer the alternative approach: _I_ decide the order of dirs in the PATH env. If I introduce an executable with a name, that overrides a system one - I probably do that intentionally. If I introduce an alias (like `grep='grep --binary-files=without-match --ignore-case --color=auto`) that matches the name of a system binary - I probably do that intentionally. And if I EVER need to call grep…

I do the same thing, but I also have a command that shows me what functions or scripts might be shadowing other scripts
Post reply on HN