现在的位置: 首页 > 综合 > 正文

一个shell脚本调用另外一个脚本

2014年10月08日 ⁄ 综合 ⁄ 共 289字 ⁄ 字号 评论关闭
原帖:
脚本 first (测试示例1)
first
#!/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

抱歉!评论已关闭.