#
# /etc/profile.d/fluent.sh
#
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
# Path manipulation
pathmunge /usr/local/Fluent.Inc/bin after
unset pathmunge
LM_LICENSE_FILE=7241@quetzal.cie.unam.mx
export PATH LM_LICENSE_FILE
3 comentarios:
# is $1 missing from $2 (or PATH) ?
no_path() {
eval "case :\$${2-PATH}: in *:$1:*) return 1;; *) return 0;; esac"
}
# if $1 exists and is not in path, append it
add_path () {
[ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1"
}
# if $1 exists and is not in path, prepend it
pre_path () {
[ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}"
}
add_path /usr/local/Fluent.Inc/bin
LM_LICENSE_FILE=7241@quetzal.cie.unam.mx
export PATH LM_LICENSE_FILE
Interesante. Aunque la verdad, me hace falta el archivo fluent.csh lo bueno que todos usamos bash.
Publicar un comentario