Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Erlang switching
export PATH="$HOME/erlang/current/bin:$PATH"
# Detects the current erlang version
erlcur() {
DIR=`ls -lr $HOME/erlang | awk '/current/ { print $NF }'`
echo -n ${DIR##*/}
# Switches to the given erlang version using wildcards
erlsw() {
TARGET=`find $HOME/erlang -depth 1 -type d -name "*$1*" | head -1`
if [ -z "$TARGET" ]; then
echo "No release matching $1\!"
if [ -e $HOME/erlang/current ]; then
echo Using `erlcur`
ln -vnfs $TARGET $HOME/erlang/current
echo Using `erlcur`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.