Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Trying to set up ~/bin directory

Hello all,


I'm trying set up my local bin directory like I have it in Ubuntu, so I can store my scripts that allow me to run them like regular bash commands. I've look around the forums and google and feel more confused. I've upgraded to Mavericks and am not sure which file to make my edits to. /etc/paths, /etc/paths.d, /etc/bashrc, ...


In Ubuntu all I had to do was edit my ~/.bashrc file with the following :


export PATH=$PATH:/home/myUserName/bin


# Alias definitions.

# You may want to put all your additions into a separate file like

# ~/.bash_aliases, instead of adding them here directly.

# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then

. ~/.bash_aliases

fi


It would be a pain to put all of my scripts in /bin folder and chmod o+w myScript.sh. I also feel like that is bad practice. Any help would be greatly appreciated.


Thanks

-E

MacBook Air (13-inch Mid 2011), OS X Mavericks (10.9)

Posted on Oct 31, 2013 9:21 PM

Reply
24 replies

Nov 4, 2013 8:19 AM in response to Drew Reece

Drew Reece wrote:


I think the Macports users have moved on to homebrew.

http://brew.sh/


I build myself too, but there are times I wish tools are just an apt-get away.

It's not the specific port package I disagree with, it is the philosophy. Using any ports package means your machine is essentially always a unique operating system unlike any other, including the machine right next to it. When there are problems, and there always are, you are on your own to debug it. The package authors can't help because you are using some ports package. Apple can't help because you aren't using OS X anymore. Other uses of your particular ports machine will try to help, but your OS is now unique.


I have racks and racks of Linux machines and a support staff to keep them running. Every single machine is different. Sometimes I will go for months while IT tries to track down the library incompatibilities. Until then, my only option is to use machines that haven't been updated as recently. Eventually, they all get updated but the cycle always happens again. I firmly believe that people shouldn't run ports packages if they don't spare machines to use while the sysadmins fix the broken ones (assuming of course you have a full-time staff of sysadmins). You can spend your own time to track down and resolve the problems, but then why are you running a Mac?


And even on Linux, tools are never just an apt-get away. Most of them are, but those are the ones that are easy to build to begin with. I recently had the joy of setting up a new Linux machine from scratch. It was just a web server with standard packages. In 2013, that still requires editing source code to make it work.

Nov 4, 2013 8:21 AM in response to etresoft

Etresoft, I know you do not like any package manager, but I have a few MacPorts.org provided packages, as it was easier than trying to get all the necessary dependencies.


It is a personal preference.


I build my own bash and Vim and put them in ~/local/...


However, for the most part, I just use the tools provied with Mac OS X.


Re Homebrew <http://brew.sh/> I was unaware of that service. I may have to check it out. Again a personal choice 🙂

Nov 4, 2013 8:45 AM in response to etresoft

My perspective is more from single users with thier own machines, so if they break it via ports they get to work out how to fix or live with it.


I can see your points but aren't all machines "unique snowflakes" once you go down the route of compiling software?


I think it would help if Apple updated the tools they installed ocassionally (e.g. rsync still has no xattrs or ACL support & is stuck on v2.6.9 from 2006!)

Nov 4, 2013 10:10 AM in response to Drew Reece

rsync could be updated, as it is still GPL v2, however, many of the tools have moved to GPL v3 which prohibits Apple (and other commercial companies) from including them in their software distributions, unless the commercial company wants to open source all their sources.


For rsync, I just use the one from Carbon Copy Cloner, as the CCC author keeps his version updated with all the relevant Mac OS X related patches.


And of course, there is the fact that Apple is not interested in selling a Unix system. Unix just happens to be a substrate to build the Mac OS X GUI on.

Nov 4, 2013 10:39 AM in response to BobHarris

BobHarris wrote:


rsync could be updated, as it is still GPL v2, however, many of the tools have moved to GPL v3 which prohibits Apple (and other commercial companies) from including them in their software distributions, unless the commercial company wants to open source all their sources.

Nope, rsync 2.6.9 is the last GPLv2. Anything after that is GPLv3.


GPLv3 goes far beyond open source - hence the problem. Apple would not have to open source everything to use rsync >3. Apple would have give up all patents and DRM. By contast, Google and others, who sell services rather than products, are under no such obligation. They can have their cake and eat it too.


It really discourages any new open source work from Apple. Any contribution or bug fix must be checked to ensure it wasn't copied from some GPLv3 project.

Nov 4, 2013 10:54 AM in response to BobHarris


BobHarris wrote:


Etresoft, I know you do not like any package manager, but I have a few MacPorts.org provided packages, as it was easier than trying to get all the necessary dependencies.


It is a personal preference.



No. It is a privilege. You can build them all if you need to. The ports are just a convenience. If your path gets screwed up or something, you can easily fix it.


By relying on these package managers instead of building stand-alone installers, people just perpetuate the status quo. You have to literally be a rocket scientist to install this still. You can rely on the ports packages, but then you are dependent on them. If you want to upgrade to Mavericks or something, you first have to check with any vendor you depend on.


I build my own bash and Vim and put them in ~/local/...


I use zsh. It isn't GPL.

Nov 4, 2013 11:02 AM in response to Drew Reece

Drew Reece wrote:


Does the new 'free' nature of OS X have any bearing on this or is that the wrong type of free.

No. I wouldn't get too caught up into the word "free". It is just political propaganda. There is a lot of money and power being exchanged behind the scenes in the technology industry. Things aren't what they seem or what people tell you they are.

Trying to set up ~/bin directory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.