Detect exported functions with %%
Since bash 4.4 functions have been exported with %%
as the suffix instead of ()
:
On aivoadm
this causes an error message on login:
********************************************************************************
* ---- LbEnv ---- *
********************************************************************************
--- User_release_area is set to /afs/cern.ch/user/c/cburr/cmtuser
--- CMAKE_PREFIX_PATH is set to:
/cvmfs/lhcb.cern.ch/lib/lhcb
/cvmfs/lhcb.cern.ch/lib/lcg/releases
/cvmfs/lhcb.cern.ch/lib/lcg/app/releases
/cvmfs/lhcb.cern.ch/lib/lcg/external
/cvmfs/lhcb.cern.ch/lib/contrib
/cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/2199/stable/linux-64/lib/python3.8/site-packages/LbDevTools/data/cmake
--------------------------------------------------------------------------------
-bash: export: `BASH_FUNC_which%%=() { ( alias; eval declare -f ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "\$@" }': not a valid identifier
cc @chaen who originally noticed this