当前脚本文件中调用另外一个脚本

脚本 first.sh

代码:

#!/bin/bash
echo 'your are in first file'

方法一: 使用source
代码:

#!/bin/bash
echo 'your are in second file'
source first

方法二: 使用.
代码:

#!/bin/bash
echo 'your are in second file'
. first

 

方法二: 使用sh
代码:

#!/bin/bash
echo 'your are in second file'
sh first

posted @ 2012-10-19 15:25  Alex~  阅读(172)  评论(0编辑  收藏  举报