读取environment-variable-mac.ini文件中变量,写入到一个js格式的文件内

environment-variable-mac.ini文件

UNIVER_USER_LOGIN='http://127.0.0.1/api/login'UNIVER_SEARCH_ORDINARY='http://127.0.0.1/api/search/common'UNIVER_SEARCH_LABEL='http://127.0.0.1/api/search/common'UNIVER_SEARCH_VIDEO='http://127.0.0.1/api/search/common'UNIVER_TASK_MANAGER='http://127.0.0.1/api/task/manager'UNIVER_PROJECR_URL='67.110.220.11'UNIVER_PROJECR_PORT=777778888

怎么才能实现?


潇潇雨雨
浏览 760回答 1
1回答

慕神8447489

使用awk命令即可awk -F '=' 'BEGIN {print "{"} {print "\t"$1":"$2","} END{print "}"}' environment-variable-mac.ini > environment-variable-mac.json
打开App,查看更多内容
随时随地看视频慕课网APP