![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell
天河~
这个作者很懒,什么都没留下…
展开
-
Shell读取带空格的文本并存到数组中
脚本主要功能是加载文件,按行将数据存到数组当中,但是如果数据当中有空格,则无法正常存储数据,使用下面方法可以解决此问题脚本代码如下:#!/bin/bashOIFS=$IFSsource ~/.bash_profile#程序根目录baseDirForScriptSelf=$(cd "$(dirname "$0")"; pwd)#文件目录file_path=${baseDirForS...原创 2020-05-05 14:56:29 · 4024 阅读 · 0 评论 -
Shell脚本使用source命令加载配置文件
配置文件pro.properties内容如下:#参数列表city=beijing,shanghname="zhang san"Shell脚本test_pro.sh如下:#!/bin/bashOIFS=$IFSsource ~/.bash_profile#程序根目录baseDirForScriptSelf=$(cd "$(dirname "$0")"; pwd)#加载主配置...原创 2020-05-05 14:23:19 · 3082 阅读 · 0 评论