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
相關文章
相關標籤/搜索