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.
所以这是在一个shell脚本中:
#!/bin/bash trialName= "trial.txt" chmod a+rwx $trialName
这真的行不通。我正在尝试添加单引号/双引号,$trialName但这也不起作用。我有什么办法可以做到吗?
$trialName
您需要删除之后的空格=:
=
trialName="trial.txt" # note the absence of the space between '=' and '"' chmod a+rwx "$trialName"
#!/bin/bash TRIALNAME="trial.txt" chmod a+rwx $TRIALNAME
它有效吗?之间不能有空格=