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

相关文章:

  • 2021-09-04
  • 2022-03-09
  • 2021-12-04
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-06-05
猜你喜欢
  • 2021-09-27
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案