fix bug that left ':'s behind and put only current (which is highest) EPICS version in PATH

This commit is contained in:
2024-04-04 16:58:49 +02:00
parent 87dea74dcd
commit cb710920d0
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
_OLD_EXTGLOB=$(shopt -p extglob)
shopt -s extglob
test -n "$EPICS_HOST_ARCH" || export EPICS_HOST_ARCH=$(/bin/sed "s%cpe:/o:redhat:enterprise_linux:\([0-9]*\).*%RHEL\1-`/bin/uname -m`%" /etc/system-release-cpe)
PATH=${PATH//\/usr\/local\/epics\/base-+([0-9]).+([0-9]).+([0-9])\/bin\/$EPICS_HOST_ARCH}:$(echo $(ls -dvr /usr/local/epics/base-+([0-9]).+([0-9]).+([0-9])/bin/$EPICS_HOST_ARCH) | tr ' ' :)
PATH=${PATH//?(:)\/usr\/local\/epics\/base-+([0-9]).+([0-9]).+([0-9])\/bin\/$EPICS_HOST_ARCH}:$EPICS_BASE/bin/$EPICS_HOST_ARCH
eval $_OLD_EXTGLOB
unset _OLD_EXTGLOB