假如有脚本 first.sh:
#!/bin/bash
#------------------
#@file:first.sh
#------------------
echo 'your are in first file'
如何在其它Shell脚本中调用first.sh呢?主要有三种方法:source、点号以及sh命令。
1.source
#!/bin/bash
#---------------
#@file:second.sh
#---------------
echo 'your are in second file'
source first.sh
2.点号.