Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为的变量instdir,它具有当前目录。我需要将其值传递给将写入文件的多行字符串。以instdir斜线结尾,我不能做这样的事情:
instdir
cat > test <<EOF $instdir/final/path/to/file EOF
但如果我$instdirfinal改用,它不会识别 realinstdir的价值。我想做什么?
$instdirfinal
这是诀窍:
${instdir}final
cat > test <<EOF ${instdir}final/path/to/file EOF