Shell读取hdfs配置文件内容

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_43215250/article/details/84847430

hdfs上文件内容

[root@node00 test]# hdfs dfs -cat /test/jdbc.properties
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://192.168.10.1:3306/
jdbc.username=root
jdbc.password=123456

读取内容脚本

#!/bin/bash
user=`hdfs dfs -cat /test/jdbc.properties |sed '/^jdbc.username=/!d;s/.*=//'`
echo $user

猜你喜欢

转载自blog.csdn.net/weixin_43215250/article/details/84847430