假设文件first.sh内容如下:
#!/bin/bash
echo'your are in first file'
1)使用source:
#!/bin/bash
echo'your are in second file'
sourcefirst
2)使用.:
#!/bin/bash
echo'your are in second file'
.first
注:.后面有一个空格。
3)使用sh
#!/bin/bash
echo'your are in second file'
sh first