I always have ~/bin
added to the $PATH
in my ~/.profile
. As is default in Ubuntu.
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
However, when trying out software, hacking together a script, or testing new software that has no PPA's, makefiles and such, I prefer to organize them in directories. For example (I have about twelve of these projects in my ~/bin at this moment):
ber@audrey:~ ☙ ls bin/replicatorg-0033/
contributors.txt examples lib-i686 license.txt readme.txt scripts todo.txt
docs lib lib-x86_64 machines replicatorg skein_engines tools
This is some java application. replicatorg
is the executable.
Now, I could do four things, but I am looking for another, better way:
- Symlink the exectuable in
~/bin
.ln -s bin/replicatorg-0033/replicatorg bin/replicatorg
. This sometimes works, not in this case. The application is poorly written and expects libraries relative to its binary: it will not run when symlinked or copied out of its directory. - Add every subdirectory to $PATH as well. But that means editing ~/.profile everytime I move, download or git-clone new directories.
- Install the applications properly systemwide by creating a makefile/install script. Seen as that most of the applications are quick hacks, ugly, in development, scripts and tools, that is not a good idea, IMHO.
- Move all the contents of ~/replicatorg-0033/ into ~/bin. Right.
So: how do you organize your ~/bin
?