Earlier quoted context omitted.
Naming a file with a "-" as the first character means you have to be careful to use "--" with commands to signify the end of options as otherwise the filename will be interpreted as being additional options with unexpected results. e.g. ls -l -- * Even when you're not deliberately operating on the commands, it's too easy to get caught out by it with wildcards etc.
Sure, but this would be contained to when your CWD is ~/bin or ~/.local/bin (or wherever you put your "-" scripts in).
Start all of your commands with a comma (2009)
241–250 of 252 posts
Re: Start all of your commands with a comma (2009)
#242Earlier quoted context omitted.
How does your sandbox ruleset look? I've been using containers on Linux but I don't have a solution for macOS.
Here's my ruleset https://gist.github.com/eugene1g/ad3ff9783396e2cf35354689cc6... My goal is to prevent Claude from blowing up my computer by erasing things it shouldn't touch. So the philosophy of my sanboxing is "You get write access to $allowlist, and read access to everything except for $blocklist". I'm not concerned about data exfiltration, as implementing it well in a dev tool is too difficult, so my rules are…
Thank you for sharing a non-trivial working example of a sandbox-exec configuration. Having an exemplar such as what you have kindly shared is hugely beneficial for those of us looking to see what can be done with a tool such as this.
Re: Start all of your commands with a comma (2009)
#243$HOME/bin/cmd
c=$HOME/bin/ ; ${c}cmd # if you really are dead set on obfuscating your scripts.
Rather than the limited "magic of tab completion" I prefer the simple, yet general ls $HOME/bin
Re: Start all of your commands with a comma (2009)
#244Every 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.
You never used CVS/RCS with its “,v” files?
I was learning Pascal on AT&T 3B2 systems. They were running SVR3. Perfectly normal clustered systems with nifty things like RFS. We were all logged in via dumb terminals, and the machines were sequestered on another floor. I had pictured them as big, really big. But 3B2s were not.
Anyway, our first lessons were how to use the Bourne shell and how to use "vi" to edit our source code.
I had learned to type 4 years previously, so I was already fast and fearsomely accurate. But I still made mistakes.
So one day I typed "ci filename.p" and then I had an hour's worth of sheer horror!
"ci" had not spawned the visual editor as I had hoped, but it did something inexplicable to that file! It had renamed it to "filename.p,v" and had put a bunch of garbage into it!
I can't remember how much "RCS garbage" was inserted, or how much cleanup I needed to do. For some reason, our TA/lab assistants were not available for me to ask! I was in a cold sweat, because all my hard classwork had been utterly mangled by this unfeeling machine, and I didn't know how to effectively undo it.
Eventually I learned about the RCS system, and what those curious "$...$" symbols meant, and I think I worked out a way to "undo" it (which I think consisted of merely "co" to checkout the file again.)
But it was a rude awakening to the fact that simple command-line typos could have some very unintended consequences!
Re: Start all of your commands with a comma (2009)
#245Earlier quoted context omitted.
Here's my ruleset https://gist.github.com/eugene1g/ad3ff9783396e2cf35354689cc6... My goal is to prevent Claude from blowing up my computer by erasing things it shouldn't touch. So the philosophy of my sanboxing is "You get write access to $allowlist, and read access to everything except for $blocklist". I'm not concerned about data exfiltration, as implementing it well in a dev tool is too difficult, so my rules are…
> Here's my ruleset ... Thank you for sharing a non-trivial working example of a sandbox-exec configuration. Having an exemplar such as what you have kindly shared is hugely beneficial for those of us looking to see what can be done with a tool such as this.
Re: Start all of your commands with a comma (2009)
#246Earlier quoted context omitted.
> Here's my ruleset ... Thank you for sharing a non-trivial working example of a sandbox-exec configuration. Having an exemplar such as what you have kindly shared is hugely beneficial for those of us looking to see what can be done with a tool such as this.
Thank you - you inspired me to open-source this work properly -> https://eugene1g.github.io/agent-safehouse/
It is both myself and the OSS community which thank you.
Great things are done by a series of small things brought
together.[0]
0 - https://www.brainyquote.com/quotes/vincent_van_gogh_120866Re: Start all of your commands with a comma (2009)
#247Earlier quoted context omitted.
As a non-native English speaker and writer/typer I'm not well versed in usage of commas unfortunately. Feel free to add the required ones while reading this comment. Sorry for the inconvenience this might create.
This is an example of the difficulty in expressing tone through text. Meant it as a passing lighthearted observational joke. No inconvenience at all.
Re: Start all of your commands with a comma (2009)
#248I 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 just prefix it with a backslash: \grep I have an almost identical grep alias. Word of warning, I use `\grep` quite frequently. The usage is when you are piping after grep or saving to a variable. Illustrative example: $ TO_DL=$(curl "https://foo.com/releases/" \ | grep -e "latest" \ | head -n1 \ ) $ curl $TO_DL curl: (3) bad range in URL position XX https://foo.com/releases/latest.tar.gz ^^^^^^ Annoyingly `--colo…
Re: Start all of your commands with a comma (2009)
#249Every 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.
You may enjoy learning about the [ binary.
Re: Start all of your commands with a comma (2009)
#250Earlier quoted context omitted.
Yes??? :) I'm not the crazy one here! That's a whole two characters on the same side of the keyboard...
How often do you find yourself running executables from the current directory? Is this a daily thing?