在bash中设置和导出多个环境变量为相同的值(Set and export multiple environment variables to the same value in bash)
我想为区域设置环境变量设置相同的值: LC_CTYPE , LC_ALL , LANG 。
我希望能够直接在交互式bash shell中设置它,如下所示:
$ export LC_CTYPE=$LANG=$LC_ALL=C此答案将相同的值分配给多个变量显示如何在脚本中执行此操作,但不在交互式shell中。
I would like to set the same value to the locale environment variables: LC_CTYPE, LC_ALL, LANG.
I want to be able to set it directly on the interactive bash shell, something like this:
$ export LC_CTYPE=$LANG=$LC_ALL=CThis answer Assign same value to multiple variables shows how to do it in a script, but not in the interactive shell.
最满意答案
您提供的参考不是shell参考,它是一个PHP示例。
在shell中,一种方法是使用循环:
for i in FOO BAR BAZ; do export $i=value doneThe reference provided by you isn't a shell reference, it's a PHP example.
In shell, one way would be to use a loop:
for i in FOO BAR BAZ; do export $i=value done更多推荐
发布评论