- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The most recent version of the shell script compilervars.sh added a section to
remove duplicate paths. Its fine for bash, but breaks zsh (whis no default in MacOS.
"echo $(!arg) " is incorrect syntax in the zshell scripting.
I found the fix below , It might be useful for anyone using zhell on macos.
I not sure how to report this to the product team.
(the uncorrected script destroys $PATH for command line users))
Broken script
------------------function remove_duplicate_paths----------------------------
remove_duplicate_paths() {
local arg=$1
if [ "${INTEL_HOST_PLATFORM}" = "Darwin" ]; then
local arr=(`echo ${!arg} | sed 's/:/\'$'\n/g'`)
else
local arr=(`echo ${!arg} | sed 's/:/\n/g'`)
fi
fixed script below
# ------------------function remove_duplicate_paths----------------------------
remove_duplicate_paths() {
local arg=$1
eval "value=\"\${$arg}\""
if [ "${INTEL_HOST_PLATFORM}" = "Darwin" ]; then
local arr=(`echo ${value} | sed 's/:/\'$'\n/g'`)
else
local arr=(`echo ${!arg} | sed 's/:/\n/g'`)
fi
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
we know about this one. We have, to date, not supported zsh. Given that Apple is forcing us to zsh we're adding full POSIX support for zsh and ksh in a future update.
Simplest workaround is:
% bash -c 'source /opt/intel/bin/compilervars.sh intel64 ; exec zsh'
Which will end up with a new zsh instance, so if you exit from the new instance you will lose the env vars.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page