将属性文件读/合并到1行,而忽略UNIX shell中的注释

时间:2019-05-08 11:15:50

标签: bash shell unix sh properties-file

环境:Unix shell(例如BusyBox,使用#!/ bin / sh)

任务:将属性文件读入单个变量,忽略注释(#)和空行。用空格替换CR | LF | CRLF。

属性文件,例如:

a=1

b=2
# comment
c.x.y.z = 3 #ignore this comment, but not the entry

0 个答案:

没有答案
相关问题