shell中调用另外的脚本文件的两种方法
时间:2010-03-28 来源:star_zhang
脚本 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
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
相关阅读 更多 +