九溪

溪水润知林,滴露启慧心

用户工具

站点工具


wiki:linux:sh-run

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

后一修订版
前一修订版
wiki:linux:sh-run [2019/09/27 11:08] – 创建 colinwiki:linux:sh-run [2023/01/03 15:25] (当前版本) – 外部编辑 127.0.0.1
行 3: 行 3:
 ===== .sh 脚本 ===== ===== .sh 脚本 =====
  
-...+一个典型的sh脚本示例: 
 +<code bash hello.sh> 
 +#!/bin/bash 
 + 
 +ls -all 
 +</code>
  
 ===== 运行 .sh ===== ===== 运行 .sh =====
行 12: 行 17:
  
   chmod u+x hello.sh   chmod u+x hello.sh
-   
   ./hello.sh   ./hello.sh
      
行 18: 行 22:
  
   sh hello.sh   sh hello.sh
 +  
  
 +三、绝对路径执行 .sh
 +
 +这样
 +  /home/hello.sh
 +  
 +或者
 +  ./home/hello.sh
 +
 +或者
 +  sh /home/hello.sh
 +  
 +===== 应用场景 =====
 +  - [[.auto-backup-use-jianguoyun]]
wiki/linux/sh-run.1569553696.txt.gz · 最后更改: 2023/01/03 15:24 (外部编辑)