Linux中执行shell脚本的方法

admin 2017-03-18 0 次浏览


相关推荐: linux执行sh脚本的几种方式  linux执行sh  linux怎么编写shell脚本  linux执行shell  linux执行sh脚本命令  linux中shell脚本怎么执行  shell脚本中执行linux命令  linuxshell脚本执行  linuxshell执行  linux执行shell脚本函数  linux编写shell脚本  shell循环执行linux命令  linux怎么运行shell脚本  linux编写shell脚本命令  linux中怎么运行shell脚本  linux执行shell脚本  linux中如何运行shell脚本  Linux中如何执行shell脚本  linux怎么创建shell脚本  linux创建shell脚本文件  linux创建shell脚本  linux中执行shell脚本  linux执行shell脚本的方式  如何在Linux执行shell跑脚本  linux开机启动shell脚本  linux执行shell命令  shell脚本和linux命令区别  linux双击运行shell脚本  linuxshell脚本执行命令  linuxshell怎么执行  linux执行shell脚本命令  linux中如何执行脚本  linux执行shell程序  linux如何执行shell  linux执行shell文件  Linux如何执行shell脚本  linux怎么执行shell脚本  shell执行linux指令写法 

你想知道Linux中执行shell脚本的方法么?下面是小编为大家收集的Linux中执行shell脚本的方法,希望能帮到大家。

Linux中执行shell脚本的方法

Linux中执行shell脚本的方法一:切换到shell脚本所在的目录(此时,称为工作目录)执行shell脚本:

复制代码 代码如下:

cd /data/shell

./hello.sh

./的意思是说在当前的工作目录下执行hello.sh。如果不加上./,bash可能会响应找到不到hello.sh的错误信息。因为目前的工作目录(/data/shell)可能不在执行程序默认的搜索路径之列,也就是说,不在环境变量PASH的内容之中。查看PATH的内容可用 echo $PASH 命令。现在的/data/shell就不在环境变量PASH中的,所以必须加上./才可执行。

请关闭浏览器的畅读模式或者取消屏蔽JavaScript的正常运行,避免出现内容显示不全或者段落错乱。

原网页地址:https://www.potelypower.com/xuexi/2865837.html