因此,这在shell脚本中:
#!/bin/bash
trialName= "trial.txt"
chmod a+rwx $trialName
Run Code Online (Sandbox Code Playgroud)
那真的行不通。我正在尝试添加单引号/双引号,$trialName但这也不起作用。有什么办法可以做到吗?
您需要在后面删除空格=:
trialName="trial.txt" # note the absence of the space between '=' and '"'
chmod a+rwx "$trialName"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20253 次 |
| 最近记录: |