shell脚本读取配置文件【有图有真相】

配置文件config.properties

#以下是配置文件内容,配置文件文件名为config.properties
username=jack
password=33281

  shell脚本(脚本名为 readConfig.sh)

#!/bin/bash
source ./config.properties
echo ${username}

   注意:我这里把config.properties和readConfig.sh放置在同一文件夹下

  执行结果贴图

说明:如果转载请注明出处!!

猜你喜欢

转载自blog.csdn.net/qq_36684665/article/details/81134179