News for hackers. Stuff that matters.
Re:Minimal safe Bash script template by eropple on Tuesday December 15, 2020 @07:02PM (#25437179)
What you describe is 100% real and is why `brew install coreutils findutils gnu-sed` has always been a prerequisite for any developer whose dev environment I've been tasked with supporting.
Re:Minimal safe Bash script template by xmodem on Tuesday December 15, 2020 @07:54PM (#25437636)
That’s definitely one solution and I have resorted to it from time to time, but it’s far from perfect - now anything that detects macOS and uses different options is broken.
Re:Minimal safe Bash script template by eropple on Wednesday December 16, 2020 @11:41AM (#25444654)
So what you can do, though, is not link them in and your scripts can use their Homebrew directory to get ahold of the GNU binaries. It is still a script change you have to make, but it's one you can make at a top level and then your bash wranglers are very unlikely to break them.

(Though I use those as daily-driver packages on Macs and have actually never had something break? GNU tools tend to support BSD options.)

Re:Minimal safe Bash script template by xmodem on Thursday December 17, 2020 @07:23AM (#25454925)
Maybe this is easier with the way homebrew does things (I prefer MacPorts) but then you have to manage a bunch of symlinks to bring in the stuff you DO want to use by default.

I actually hadn't thought to try this approach, though. The next time this happens I will definitely give it a shot.

Re:Minimal safe Bash script template by eropple on Thursday December 17, 2020 @11:21AM (#25456968)
Homebrew does collate them all in a couple of directories for you, yeah.