赵小黑 发表于 2017-5-16 07:07:57

shell中调用另外的脚本文件的两种方法

脚本 first (测试示例1)
代码:
#!/bin/bash
echo 'your are in first file'


问) 在当前脚本文件中调用另外一个脚本文件?
方法一: 使用source
脚本 second (测试示例2)
代码:
#!/bin/bash
echo 'your are in second file'
source first

方法二: 使用.
脚本 second (测试示例3)
代码:
#!/bin/bash
echo 'your are in second file'
. first

  

_________________
页: [1]
查看完整版本: shell中调用另外的脚本文件的两种方法