Skip to content

source etc/cshrc fails when given with more than 1 argument

Summary

A syntax error is returned if etc/cshrc is sourced with more than 1 argument.

Steps to reproduce

In a c-shell. running the command (for example):

source ~/OpenFOAM/OpenFOAM-v1912/etc/cshrc WM_PRECISION_OPTION=DP WM_LABEL_SIZE=32

Example case

N/A

What is the current bug behaviour?

The shell returns:

Syntax Error.

and OpenFOAM environment variables aren't set as expected.

What is the expected correct behavior?

No error returned and the environment variables set as expected!

Relevant logs and/or images

N/A

Environment information

  • OpenFOAM version : v1812, v1906, v1912
  • Operating system : Centos6
  • Hardware info : N/A
  • Compiler : N/A

Possible fixes

This bug appears to be related to the movement of some lines from etc/cshrc to etc/config.csh/setup and the way that the command-line arguments are passed and then interpreted. One way to fix this is by replacing the line:

source "$WM_PROJECT_DIR/etc/config.csh/setup" "${*}"

in etc/cshrc by:

source "$WM_PROJECT_DIR/etc/config.csh/setup" $argv:q