我有一个包含内容的文本文件 test.hd
gated window upper limit:=1.15
gated window lower limit:=0.87
gated frame mode:=variable time
gated beats accepted:=631
gated beats rejected:=1
gated longest beat:=1.0455
gated shortest beat:=0.8722
gated average beat:=0.9472
applied zoom:=2.15
zoom origin x:=272
zoom origin y:=288
在我的 shell 脚本中,我想使用 sed 或 perl one liner 分配一个变量最长节拍和最短节拍。目前我可以用更多,grep 和 cut
more test.hd | grep 'longest beat' | cut -f 2 -d =