- shell脚本结构
- shell脚本执行的三种方式
- 1.给shell脚本赋予执行权限,再通过路径执行
- 2.将shell脚本移动到“/usr/local/bin”目录下,便可任意目录下执行脚本
- 3.使用bash命令执行
shell脚本编程:是基于过程式、解释执行的语言
高级编程语言:
编译:高级语言–>编译器–>机器代码文件–>执行,如:C,C++
解析:高级语言–>执行–>解释器–>机器代码,如:shell,python,php,JavaScript
java比较特殊,java是编译和解析结合性的高级编程语言。
shell脚本执行的三种方式 1.给shell脚本赋予执行权限,再通过路径执行chmod -x hello.sh #赋予执行权限 chmod 777 hello.s #赋予最高的权限
不知道为什么我“chmod -x hello.sh”失败
[root@centos8 ~]# bash ./hi.sh This is first shell [root@centos8 ~]# cat hi.sh |bash This is first shell [root@centos8 ~]#



