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

2019/7/10 21:52:08

本文主要是介绍Shell中调用、引用、包含另一个脚本文件的三种方法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

脚本 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



这篇关于Shell中调用、引用、包含另一个脚本文件的三种方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


暂无数据...
扫一扫关注最新编程教程