0

I've recently upgraded from Mavericks to High Sierra.

I had some shell scripts in /bin which were not copied. Now modifying /bin is not permitted even as root.

Is possible to keep my own scripts in /bin?

Or is there a better way than creating a load of aliases in .bash_profile?

Apologies for my ignorance and many thanks

p.s. Having seen the damage Yosemite and El Capitan did to other older Macs I was very reluctant to upgrade from a fairly snappy and stable Mavericks. Initial indications seem ok though...

0

In general, only the base OS binaries and scripts should be in installed in /bin (and /sbin, /usr/bin, and /usr/sbin). Local customizations and add-on binaries should go in /usr/local/bin. /usr/local/bin doesn't exist by default in macOS, but you can create it (as root) and put whatever you want in it. It's already in the default PATH, so it'll be searched for commands.

One thing to watch out for: since it's before the other directories in the default PATH, command names there will generally override standard commands with the same name. This can cause trouble if you install something there with that behaves differently than the standard command. For example, if you installed GNU sed there as /usr/local/bin/sed, anything that uses sed and expects the BSD sed behavior... may break because GNU sed is slightly different. Thus it's best to install things with different names (e.g. GNU sed as /usr/local/bin/gsed).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.