json用jq是正解
【 在 world (You are my world) 的大作中提到: 】
: 标 题: Re: 请问shell命令提取文本字符串的写法?
: 发信站: 水木社区 (Tue Oct 26 17:13:39 2021), 站内
:
: json用jq, 用grep可以这样写:
: grep -oP '(?<="key":")\w+'
:
: 【 在 flyacat (放·逐) 的大作中提到: 】
: : 文件1.json里有一特定字符串,想提取出来,数据类型大概这样:
: : ...}]},"key":"B4923BA821899B94978C10a3CB1fD20835","update":true},...
: : result=`cat 1.json`
: : ...................
:
: --
: 辟谣:2012年12月21不是我的末日。
:
:
: ※ 来源:·水木社区 mysmth.net·[FROM: 114.245.104.*]
--
FROM 124.207.188.194