脚本 first (测试示例1)
first.sh
#!/bin/bash
echo 'your are in first file'
方法一:使用source
#!/bin/bash
echo 'your are in second file'
source first
当执行secondFile时的结果:
your are in first file
your are in second file
方法二:使用.
#!/bin/bash
echo 'your are in second file'
. first
当执行secondFile时的结果:
your are in first file
your are in second file