linux为脚本文件添加可执行权限
假设编写完了一个script.sh,没有可执行权限x肯定是无法运行的:
[root@localhost ~]# ./script.sh -bash: ./script.sh: 权限不够
此时,我们要添加x权限:
[root@localhost ~]# chmod +x script.sh
然后就可以执行了:
[root@localhost ~]# ./script.sh hello,world!
linux为脚本文件添加可执行权限
假设编写完了一个script.sh,没有可执行权限x肯定是无法运行的:
[root@localhost ~]# ./script.sh -bash: ./script.sh: 权限不够
此时,我们要添加x权限:
[root@localhost ~]# chmod +x script.sh
然后就可以执行了:
[root@localhost ~]# ./script.sh hello,world!