博客
关于我
shell中的文件包含
阅读量:681 次
发布时间:2019-03-15

本文共 342 字,大约阅读时间需要 1 分钟。

参考:、、

      和其他语言一样,Shell也可以包含外部脚本。这样可以很方便的封装一些公用的代码作为一个独立的文件。Shell 文件包含的语法格式如下:

. filename   # 注意点号(.)和文件名中间有一空格    或    source filename

test1.sh

#!/bin/bash        url="http://www.runoob.com"

test2.sh

#!/bin/bash    #使用 . 号来引用test1.sh 文件,下面代码没有错,注意两个点之间存在空格    . ./test1.sh        # 或者使用以下包含文件代码    # source ./test1.sh        echo "菜鸟教程官网地址:$url"

转载地址:http://sxzmz.baihongyu.com/

你可能感兴趣的文章
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>