【发布时间】:2013-05-06 08:56:01
【问题描述】:
当我尝试这样做时......
$ export my_path='/my/path\ with\ spaces/file'
$ echo $my_path`
/my/path\ with\ spaces/file
有效。
但我想这样做..
$ echo $my_variable
my_path='/my/path\ with\ spaces/file'
$ export $my_variable
-bash: export: `with\': not a valid identifier
-bash: export: `spaces/file'': not a valid identifier
这是我得到的错误。 有没有办法处理要导出的变量的值.. [[ 注意:如果路径没有空格,它可以完美地工作!! ]]
【问题讨论】:
标签: linux bash shell variables export