SETENV: Bad : modifier in $ ($)

18.9k views Asked by At

I am using the tcsh terminal in Linux. In the other terminal I normally used I set the path to some license file as follows:

  export PATH="$PATH:$MODEL_TECH"

Tcsh shell does not recognise this command so I tried the following:

  setenv PATH "$PATH:$MODEL_TECH"
  set PATH "$PATH:$MODEL_TECH"
  setenv PATH=("$PATH:$MODEL_TECH")

But then I always get the following error:

Bad : modifier in $ ($).

What be also great if someone could help me here out quickly, tried quite a few combinations but nothing works.

5

There are 5 answers

2
Dennis Williamson On

Put curly braces around the variable names:

setenv PATH ${PATH}:${foo}

or use this form:

set path = ($path $foo)
0
codaddict On

Drop the =

setenv LICENSE_FILE "/usr/local/softwarex/license.dat"

From the man page for tcsh:

   setenv [name [value]]

   Without  arguments, prints the names and values of all environā€
   ment variables.  Given name, sets the environment variable name
   to value or, without value, to the null string.
3
Hank Gay On

Try setenv LICENSE_FILE /usr/local/softwarex/license.dat. This should be documented in the man page somewhere on your system, so try reading up in man tcsh; tcsh is a very different beast from bash and friends. If the relevant man page isn't available on your system for some reason, here's the first man tcsh I found.

0
Rams On

On a tcsh shell the path or any environment variable can be appended as below:

setenv PATH $PATH":$NEWPATH"
0
katy On

If it's not working use this:

setenv PATH ${PATH}:/.../../../