syntax error: unexpected end of file when running source

我们两清 提交于 2020-01-17 08:16:02

问题


I have been trying to source this script from Xilinx install but it outputs an error.

source /opt/Xilinx/14.7/ISE_DS/settings32.csh

# Copyright (c) 1995-2013 Xilinx, Inc.  All rights reserved.

set SETTINGS_FILE=.settings32.csh
set XIL_SCRIPT_LOC="/opt/Xilinx/14.7/ISE_DS"
if ( $# != 0 ) then
   # The first argument is the location of Xilinx Installation.
   # Don't detect the installation location.
   set XIL_SCRIPT_LOC="$1"
else
   #  XIL_SCRIPT_LOC should point to script location
   set XIL_SCRIPT_LOC_TMP_UNI=`echo $_ | cut -d" " -f 2`
   set XIL_SCRIPT_LOC_TMP_UNI_TAIL=${XIL_SCRIPT_LOC_TMP_UNI:t}
   set XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC_TMP_UNI:h}
   if ( "$XIL_SCRIPT_LOC_TMP_UNI" != "" ) then
      if ( "$XIL_SCRIPT_LOC_TMP_UNI" == "$XIL_SCRIPT_LOC_TMP_UNI_TAIL" ) then
         set XIL_SCRIPT_LOC_TMP_UNI="./"
      endif
      set XIL_SCRIPT_LOC_TMP_UNI=`readlink -f ${XIL_SCRIPT_LOC_TMP_UNI}`
      if ( $? == 0 ) then
         set XIL_SCRIPT_LOC=${XIL_SCRIPT_LOC_TMP_UNI}
      endif
   endif
   unset XIL_SCRIPT_LOC_TMP_UNI_TAIL
   unset XIL_SCRIPT_LOC_TMP_UNI
endif

set xlnxInstLocList=""

set xlnxInstLocList="${xlnxInstLocList} common"
set xlnxInstLocList="${xlnxInstLocList} EDK"
set xlnxInstLocList="${xlnxInstLocList} PlanAhead"
set xlnxInstLocList="${xlnxInstLocList} ISE"
set XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC}
foreach i $( xlnxInstLocList )
        set d="${XIL_SCRIPT_LOC_TMP_UNI}/$i"
        set sfn="$d/$SETTINGS_FILE"
        if ( -e  "$sfn" ) then
                echo source "$sfn" "$d"
                source "$sfn" "$d"
        endif
end

bash: /opt/Xilinx/14.7/ISE_DS/settings32.csh: line 42: syntax error: unexpected end of file

Can someone see the error in the script?

来源:https://stackoverflow.com/questions/44100638/syntax-error-unexpected-end-of-file-when-running-source

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!