配置文件config.properties
#以下是配置文件内容,配置文件文件名为config.propertiesusername=jackpassword=33281
shell脚本(脚本名为 readConfig.sh)
#!/bin/bashsource ./config.propertiesecho ${username}
注意:我这里把config.properties和readConfig.sh放置在同一文件夹下。
执行结果贴图
说明:如果转载请注明出处!!
时间:2019-10-23 04:22:53
配置文件config.properties
#以下是配置文件内容,配置文件文件名为config.propertiesusername=jackpassword=33281
shell脚本(脚本名为 readConfig.sh)
#!/bin/bashsource ./config.propertiesecho ${username}
注意:我这里把config.properties和readConfig.sh放置在同一文件夹下。
执行结果贴图
说明:如果转载请注明出处!!
linux shell脚本读取配置文件 val=1 shell脚本
2020-07-12
Linux shell脚本中如何读取跟shell脚本同一目录下的配置文件
2018-08-07