【发布时间】:2020-04-29 18:36:55
【问题描述】:
我正在学习 shell 脚本并创建了一个脚本。在脚本中,我已将 find 命令输出分配给代码中的变量。但是审阅者评论说“路径需要引用,因为它们包含需要扩展的变量”。我没有得到这个。
MAIN_PROFILE="$(find /Users/$CURRENT_USER/Library/Group\ Containers/*.Office -type d -name "Main Profile")"
【问题讨论】:
-
您是否尝试过转义路径变量内部的引号?
\"Main Profile\"? -
这能回答你的问题吗? Shell script and quote in path
标签: bash