cshell setenv:参数太多

use*_*898 1 csh

我在 c-shell 中

    set value_str ="one three"
    set line_seprator = ","
    set value_and_sperator = "$value_str$line_seprator"
    setenv STRING_CONCAT $STRING_CONCAT$value_and_sperator
Run Code Online (Sandbox Code Playgroud)

我收到错误:

setenv: Too many arguments.
Run Code Online (Sandbox Code Playgroud)

这是我在脚本中设置全局变量的方法,知道为什么我收到错误吗?

sus*_*tus 5

只需要将字符串括在引号中 -csh否则会被分隔符混淆。

setenv STRING_CONCAT "$STRING_CONCAT$value_and_sperator"
Run Code Online (Sandbox Code Playgroud)