What's in my terminal

bash: settings64.csh: line 35: syntax error near unexpected token `('
bash: settings64.csh: line 35: `foreach i ( $xlnxInstLocList )'

Portion of the script

set xlnxInstLocList="${xlnxInstLocList} common"
set xlnxInstLocList="${xlnxInstLocList} EDK"
set xlnxInstLocList="${xlnxInstLocList} PlanAhead"
set xlnxInstLocList="${xlnxInstLocList} ISE"
foreach i ( $xlnxInstLocList )

Location of syntactical error at the bottom

line 35
foreach i ( $xlnxInstLocList )

I'm not a scripter; I'm trying to fix an error in the scripting for my ISE DESIGN SUITE installation. I just need a quick set of code to replace "foreach i ( $xlnxInstLocList )" to perform its intended function. I think it's a Bash script.

  • 7
    .csh more indicates a CSH script, which is so not bash. Maybe run it under csh or tcsh intead?
    – thrig
    Jan 6 '17 at 19:32
  • How do I run it in terminal?
    – caleb
    Jan 6 '17 at 19:42
  • The environment variables are written to settings[32|64].(c)sh at "/opt/Xilinx/14.7/ISE_DS". To launch the Xilinx tools, first source the settings script:
    – caleb
    Jan 6 '17 at 19:42
  • C-shell 64 bit environment... source /opt/Xilinx/14.7/ISE_DS/settings64.csh
    – caleb
    Jan 6 '17 at 19:42
  • 4
    The people who are voting to close this because it "cannot be reproduced" should be aware that not only can it be reproduced, but it has been reproduced, years ago. This is not the first nor the only person to have done this. Here's someone making the exact same error in 2011, for just one example.
    – JdeBP
    Jan 7 '17 at 7:36

Follow the actual installation instructions properly!

You buried this in a comment:

The environment variables are written to settings[32|64].(c)sh at "/opt/Xilinx/14.7/ISE_DS". To launch the Xilinx tools, first source the settings script:

C-shell 64 bit environment...
source /opt/Xilinx/14.7/ISE_DS/settings64.csh

This is just part of a larger set of unofficial instructions, and you did not read the whole thing properly. They continue on from that to say:

Shell, Bash shell, Korn Shell 64 bit environment...
. /opt/Xilinx/14.7/ISE_DS/settings64.sh

The actual instructions from Xilinx itself, as given in the "Linux installation" section of the installation guide, say:

1. Go to the XILINX installation directory

2. Type either source settings32.(c)sh or source settings64.(c)sh, as required for your shell.

As is apparent from your question, you are using the Bourne Again shell. So you should be sourcing the .sh file not the .csh file. Stop trying to fix the Xilinx script, which doesn't need fixing, and actually run the right script for your shell out of the set of scripts for different shells that Xilinx provides.

Further reading

  • "Linux Installation". Xilinx Design Tools: Installation and Licensing Guide. version 14.1. Xilinx. 2012-05-08. p. 6.

bash doesn't have a foreach; this script is probably meant to run in csh or tsch. If you are invoking the script with ./myscript.csh, make sure its first line is #!/bin/csh (or whatever the full path to that shell is on your system).


It is a csh script. Check if it is executable, else execute chmod u+x settings64.csh and run it either with ./settings64.csh or csh settings.sh

  • I have an I still get the syntax error
    – caleb
    Jan 6 '17 at 19:45
  • What Operating system are you running it on? Jan 6 '17 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.