0
点赞
收藏
分享

微信扫一扫

Shell中调用、引用、包含另一个脚本文件的三种方法

雷亚荣 2022-06-16 阅读 115

假设文件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


举报

相关推荐

0 条评论