shell文件中的'mkdir'无法创建目录:“权限被拒绝”

问题描述 投票:2回答:1

我的主文件夹中有一个shell脚本:

copy.sh

mkdir new_folder

当我从主文件夹运行shell脚本时:

./copy.sh

我收到错误消息:

-bash: ./copy.sh: Permission denied

为什么?

shell mkdir
1个回答
2
投票

您必须授予脚本执行权限:

chmod +x path_to_the_copy.sh
© www.soinside.com 2019 - 2024. All rights reserved.