milis/bin/gec

39 lines
821 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# gec betiği Python, Go, Ruby progralama dillerinde sistem geneli kullanımı için ortam değişkeni atar.
# kullanım: gec program_ismi sürüm
_program=""
_surum=""
_exit1(){
echo "program parametresi eksik"
exit 1
}
_exit2(){
echo "sürüm parametresi eksik"
exit 1
}
_exit3(){
echo "${_program} ayarları eksik"
exit 1
}
python_gec(){
if [ -f /usr/bin/${_program}${_surum} ];then
rm -rf /usr/bin/${_program}
ln -s /usr/bin/${_program}${_surum} /usr/bin/${_program}
echo "readlink -f /usr/bin/${_program} -> $(readlink -f /usr/bin/${_program})"
else
echo "/usr/bin/${_program}${_surum} dosyası bulunamadı"
exit 1
fi
}
[ -z $1 ] && _exit1 || _program=$1
[ -z $2 ] && _exit2 || _surum=$2
case ${_program} in
python) python_gec ;;
go) echo "go $_surum";;
*) _exit3;;
esac