From 76097c01f4d1ba96853426fb505c5d7b723cfe10 Mon Sep 17 00:00:00 2001 From: mollusk Date: Sat, 17 Feb 2018 20:25:18 -0700 Subject: [PATCH] New Script: symlinker.sh Former-commit-id: 41428828f6cf728cc75bbe449d04160c81dabff1 --- symlinker.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 symlinker.sh diff --git a/symlinker.sh b/symlinker.sh new file mode 100755 index 0000000..71a14a3 --- /dev/null +++ b/symlinker.sh @@ -0,0 +1,46 @@ +#!/bin/bash + + + +function juliaLang(){ + name="julia" + version="0.6.2" + linkDir="/usr/bin" + + if [ ! -f "${linkDir}/${name}" ];then + printf "\nLinking $(pwd)/${name}-${version}/bin/${name} to ${linkDir}\n" + ln -s $(pwd)/${name}-${version}/bin/${name} ${linkDir}/${name} + else + printf "\n${name} exists in $(which julia)\n" + fi +} + +function idd(){ + name="idd" + linkDir="/usr/bin" + + if [ ! -f "${linkDir}/${name}" ];then + printf "\nLinking ${pwd}/${name} to ${linkDir}\n" + ln -s ${pwd}/idd.sh ${linkDir}/${name} + else + printf "${name} already exists in $(which idd)\n" + fi + + +} + + +case "${1}" in + + julia ) + juliaLang + ;; + + idd ) + idd + ;; + + * ) printf "\n${0} \n" + ;; + +esac \ No newline at end of file