Short Answer
I think your machine uses a true csh, which does not allow arguments to source. Many modern day systems symbolically link csh
to tcsh
, which does allow arguments to source
. If you have tcsh
on your machine, change csh
to tcsh
in any/all the scripts and it should work.
Longer Answer
My guess is that this is a csh
or tcsh
or version issue. For example, on our computational cluster csh
is really a symbolic link to tcsh
.
ls -lh $(which csh)
lrwxrwxrwx 1 root root 4 2021-11-08 06:37 /usr/bin/csh -> tcsh
And, in tcsh
, source
is a built-in command which takes name
and one or more args
as described in man pages.
$ tcsh
# ...
$ which source
# source: shell built-in command.
According to the documents:
tcsh is an enhanced but completely compatible version of the Berkeley UNIX C shell, csh (1).
That really means backward compatible with additional features. My guess is that the version of csh you are using does not support args for source
. For example, these man pages for true csh shows that source does not take arguments except for name.
Run the following commands and post the output:
ls -lh $(which csh)
csh --version
csh
# a new shell will start and then type:
man source | grep source
For context, my outputs were as follows:
lrwxrwxrwx 1 root root 4 2021-11-08 06:37 /usr/bin/csh -> tcsh
tcsh 6.20.00 (Astron) 2016-11-24 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
jobs, kill, let, local, logout, mapfile, popd, printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait - bash built-
source filename [arguments]
parameters are unchanged. If the -T option is enabled, source inherits any trap on DEBUG; if it is not, any DEBUG trap string is saved and restored around the call to source, and source unsets the DEBUG trap
while it executes. If -T is not set, and the sourced file changes the DEBUG trap, the new value is retained when source completes. The return status is the status of the last command exited within the script
Returns the context of any active subroutine call (a shell function or a script executed with the . or source builtins). Without expr, caller displays the line number and source filename of the current sub‐
routine call. If a non-negative integer is supplied as expr, caller displays the line number, subroutine name, and source file corresponding to that position in the current execution call stack. This extra
inhibits the display of function definitions; only the function name and attributes are printed. If the extdebug shell option is enabled using shopt, the source file name and line number where each name is
the last command executed by the trap handler before return was invoked. If return is used outside a function, but during execution of a script by the . (source) command, it causes the shell to stop execut‐
return status is non-zero if return is supplied a non-numeric argument, or is used outside a function and not during execution of a script by . or source. Any command associated with the RETURN trap is exe‐
1. The -F option to the declare builtin displays the source file name and line number corresponding to each function name supplied as an argument.
3. If the command run by the DEBUG trap returns a value of 2, and the shell is executing in a subroutine (a shell function or a shell script executed by the . or source builtins), the shell simu‐
sourcepath
If set, the source (.) builtin uses the value of PATH to find the directory containing the file supplied as an argument. This option is enabled by default.
the DEBUG trap. If a sigspec is RETURN, the command arg is executed each time a shell function or a script executed with the . or source builtins finishes executing.
Provides control over the resources available to the shell and to processes started by it, on systems that allow such control. The -H and -S options specify that the hard or soft limit is set for the given
resource. A hard limit cannot be increased by a non-root user once it is set; a soft limit may be increased up to the value of the hard limit. If neither -H nor -S is specified, both the soft and hard limits
are set. The value of limit can be a number in the unit specified for the resource or one of the special values hard, soft, or unlimited, which stand for the current hard limit, the current soft limit, and no
limit, respectively. If limit is omitted, the current value of the soft limit of the resource is printed, unless the -H option is given. When more than one resource is specified, the limit name and unit are
If limit is given, and the -a option is not used, limit is the new value of the specified resource. If no option is given, then -f is assumed. Values are in 1024-byte increments, except for -t, which is in
I suspect you will find that your csh
is not tcsh
and your source
does not allow arguments
.