Live data from Hacker News

Start all of your commands with a comma (2009)

rhodesmill.org

181–190 of 252 posts

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

#181

Earlier quoted context omitted.

I would recommend against overriding standard system binaries, you could break compatibility on your system with scripts that depend on those binaries. I just use an abbreviation like rg=“grep -RE”

Why are those scripts running in interactive login shells? If they are influenced by the configuration of profile, then the scripts are bad.

That’s true, but I would still call overloading system binaries bad practice. Your making yourself foot gun.

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

#182
post #167

Earlier quoted context omitted.

Looked so backwards to me, too. However, I decided to give it a go, anyway. Now, I have some scripts and small commands which start with a comma, and it looks neat and time saving. Yes, I can do path ordering to override usual commands. However, having a set of odd-job scripts which start with a comma gives a nice namespacing capability alongside a well narrowed-down tab-completion experience. While it's not the neat…

The irony in the number of extra commas you've used in this comment...

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.

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

#183
post #150
post #146

Earlier quoted context omitted.

So if I want to use grep in a small script, do I have to write: /nix/store/grep-hash -flags files | /nix/store/head-hash instead of: "grep -flags files | head"?

[user@nixos:~]$ which grep /run/current-system/sw/bin/grep [user@nixos:~]$ ls -l /run/current-system/sw/bin/grep lrwxrwxrwx 1 root root 65 Jan 1 1970 /run/current-system/sw/bin/grep -> /nix/store/737jwbhw8ji13x9s88z3wpp8pxaqla92-gnugrep-3.12/bin/grep Basically, it is still in your environment, so I don't see how he can claim that this problem doesn't exist in Nix, unless you use flakes like a proper Nix afficionado.

Yes, the original comment that this problem doesn't exist in Nix is wrong for a typical user environment.

It does contain the issue a bit though:

I'm running isync in a systemd service, yet the program "mbsync" is not in my path. I have several services installed, yet their programs aren't in my path. My e-mail client shells out to "file" for mime-type verification, yet "file" is not in my path.

Run "compgen -c |wc -l" to get a list of commands; its over 7000 on my Ubuntu system and right around 2000 on my NixOS system.

As an aside, the packages that put the most executables in my path are probably going to be in the path for most NixOS installs (231 just for coreutils+util-linux):

     27 /nix/store/csxa6mi2mpjl9vqxbv2j0bha6sz6nbjw-cups-2.4.14
     31 /nix/store/334afxah19b3hr6ll93pfxlcyhhh2vws-pipewire-1.4.9
     31 /nix/store/h2jsb5i4yfblr2f3ac2c7zpmlmj7zjym-perl-5.40.0
     33 /nix/store/914x32c982bs3i1998yxvkg9svm3ycr5-shadow-4.18.0
     33 /nix/store/a6s3hzj3b2z6rsyfkjyxwn265iyfl2gn-mtools-4.0.49
     33 /nix/store/jky7jszaci5n7g426wf6nsg5dmik9nfw-kbd-2.9.0
     37 /nix/store/2v1l6mqz0d7mfpp4ksw2048v3g0a1a19-hplip-3.25.2
     45 /nix/store/90wlc37ljr6rpy2lan46bp0gq19vbgl5-iptables-1.8.11
     48 /nix/store/1byhxs7b28grh8s15jc2dvs2zg36swjb-lvm2-2.03.35-bin
     61 /nix/store/9xwxjkrwxjsvc5gs1l0syr4wbfvvvvcn-bluez-5.84
     64 /nix/store/zf8qy81dsw1vqwgh9p9n2h40s1k0g2l1-systemd-258.2
     72 /nix/store/1igrj9w84w7s3r80l3nkxcqwd84sw9mz-qemu-10.1.2
    106 /nix/store/v4q3154vdc83fxsal9syg9yppshdljyk-coreutils-full-9.8
    125 /nix/store/3c6r8gh8zrqw8xmncmlj9vivz9rz6r30-util-linux-2.41.2-bin

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

#184
post #65

Earlier quoted context omitted.

What is task?

It is like make but designed specifically for the way non-C(++) users - people like me for example adding scripts like "make run" and "make build" to my node/python/PHP/etc repos - use it. It is great! I still don't use it literally just because make is already installed on any *nix system I encounter day to day.

Interesting, I have never compared make with task but I suppose there’s some overlap. My favorite feature is that it’s cross-platform. I do use it for performing complex builds (like chaining several environment setup and docker compose commands, etc.). Of course you could do this with shell scripts, but this adds a layer of abstraction.

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

#185
post #150

Earlier quoted context omitted.

[user@nixos:~]$ which grep /run/current-system/sw/bin/grep [user@nixos:~]$ ls -l /run/current-system/sw/bin/grep lrwxrwxrwx 1 root root 65 Jan 1 1970 /run/current-system/sw/bin/grep -> /nix/store/737jwbhw8ji13x9s88z3wpp8pxaqla92-gnugrep-3.12/bin/grep Basically, it is still in your environment, so I don't see how he can claim that this problem doesn't exist in Nix, unless you use flakes like a proper Nix afficionado.

Yes, the original comment that this problem doesn't exist in Nix is wrong for a typical user environment. It does contain the issue a bit though: I'm running isync in a systemd service, yet the program "mbsync" is not in my path. I have several services installed, yet their programs aren't in my path. My e-mail client shells out to "file" for mime-type verification, yet "file" is not in my path. Run "compgen -c |wc -…

True enough, but in my experience it's not really much of a problem because if I'm not doing Nix, then I'm doing containers which are widely available.

What can be a problem is muscle memory, when you expect it to autocomplete one way and it doesn't because something you want now shares first two or three letters with something else in your path. That's where FIGNORE comes in.

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

#186

Earlier quoted context omitted.

One rarely actually needs to shadow binaries. Some cases could indeed be covered by introducing an alias that binds the binary's name to call a different copy of that binary. You use shadowing to fix issues where you install some software that expects you to have a sane and ~recent version of some tool like git, but you don't as your system provides that binary and unfortunately it is either not sane (not GENERALLY s…

> That's a poor advice for the scripts you call relatively frequently. Why? It protects you from someone else ( cough updated packages introducing new commands cough ) picking a name you already use.

Because it's useless extra typing. People try to narrow commands down to two fucking chars and you suggest to type the whole goddamn path!

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

#187

Earlier quoted context omitted.

Why are those scripts running in interactive login shells? If they are influenced by the configuration of profile, then the scripts are bad.

That’s true, but I would still call overloading system binaries bad practice. Your making yourself foot gun.

No, in fact he is correct: system scripts won't pick up your overrides configured via your shell's rc scripts.

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

#188
post #167

Earlier quoted context omitted.

The irony in the number of extra commas you've used in this comment...

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.

As a native speaker the original comment seemed completely fine, ignore them. Also, I never would never guessed that you weren't also a native English speaker.

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

#189
post #123

Earlier 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…

That's neat. I'm going to base my ruleset off of yours. I've been messing around with claude more and more lately and I need to do something.

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

#190
post #77

Earlier quoted context omitted.

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

Which file system would that be?

Many early file systems like the original FAT, RSX-11, VMS ODS-2 ... Probably not a concern for anything in the past 30 years.
Post reply on HN