1

谁能解释为什么 grepping 为“artist”返回结果,但 grepping 为“artist:”什么也没返回?

第一个结果:

MacBook-Pro:~ kjesso$ eyed3 ./Music/Deftones/2006\ -\ Saturday\ Night\ Wrist/Deftones\ -\ 02\ -\ Rapture.mp3
Deftones - 02 - Rapture.mp3 [ 5.26 MB ]
-------------------------------------------------------------------------------
Time: 03:25 MPEG1, Layer III    [ ~213 kb/s @ 44100 Hz - Joint stereo ]
-------------------------------------------------------------------------------
ID3 v2.3:
title: Rapture
artist: Deftones
album: Saturday Night Wrist
album artist: None
recording date: 2006
track: 2        genre: Rock (id 17)
Publisher/label: Maverick

第二个结果:

MacBook-Pro:~ kjesso$ eyed3 ./Music/Deftones/2006\ -\ Saturday\ Night\ Wrist/Deftones\ -\ 02\ -\ Rapture.mp3 | grep "artist"
artist: Deftones
album artist: None

第三个结果:

MacBook-Pro:~ kjesso$ eyed3 ./Music/Deftones/2006\ -\ Saturday\ Night\ Wrist/Deftones\ -\ 02\ -\ Rapture.mp3 | grep "artist:"
4

2 回答 2

2

eyed3 为颜色编码添加了一些终端标记,因此输出中有一堆字节在您的终端上不可见,但终端用于确定颜色编码 - 即使该颜色编码“完全是整个颜色相同。

添加该--no-color选项将完美地工作:

$ eyed3 --no-color ./Music/Deftones/2006\ -\ Saturday\ Night\ Wrist/Deftones\ -\ 02\ -\ Rapture.mp3 | grep "artist:"
于 2016-08-03T20:12:53.043 回答
0

您确定您正确键入了第三个实例吗?它对我有用:

$ cat foo.txt
Deftones - 02 - Rapture.mp3 [ 5.26 MB ]
-------------------------------------------------------------------------------
Time: 03:25 MPEG1, Layer III    [ ~213 kb/s @ 44100 Hz - Joint stereo ]
-------------------------------------------------------------------------------
ID3 v2.3:
title: Rapture
artist: Deftones
album: Saturday Night Wrist
album artist: None
recording date: 2006
track: 2        genre: Rock (id 17)
Publisher/label: Maverick

$ cat foo.txt | grep "artist"
artist: Deftones
album artist: None

$ cat foo.txt | grep "artist:"
artist: Deftones
album artist: None

也许您错误地输入了分号而不是冒号?

$ cat foo.txt | grep "artist;"
$
于 2016-08-03T20:05:40.103 回答