Command line argument to "find" and "grep" data inside "xattr -l" atrributes? I have a file that an application has set extended attributes for.
$ xattr -l /Volumes/Educating\ Rita\ \(1983\)/Educating\ Rita\ \(1983\).1.eng.srt
net.filebot.filename: 3_English.srt
net.filebot.metadata: {&quot;@type&quot;:&quot;Movie&quot;,&quot;year&quot;:1983,&quot;imdbId&quot;:85478,&quot;tmdbId&quot;:38291,&quot;language&quot;:&quot;en&quot;,&quot;id&quot;:38291,&quot;name&quot;:&quot;Educating Rita&quot;,&quot;aliasNames&quot;:[]}

I have tried a few different ways to get the value of @type inside the attribute but haven't found a way to search multiple files and grep for and return those values.
xattr -l /Volumes/Educating\ Rita\ \(1983\)/Educating\ Rita\ \(1983\).1.eng.srt | grep @type
net.filebot.metadata: {&quot;@type&quot;:&quot;Movie&quot;,&quot;year&quot;:1983,&quot;imdbId&quot;:85478,&quot;tmdbId&quot;:38291,&quot;language&quot;:&quot;en&quot;,&quot;id&quot;:38291,&quot;name&quot;:&quot;Educating Rita&quot;,&quot;aliasNames&quot;:[]}

I want to find every .srt file and grep for the value of @type. In the above results the command would return &quot;Movie&quot;.
$ find . -iname &quot;*.srt&quot; | while read -r file; do `xattr -l &quot;$file&quot; | grep  &quot;Type&quot; &gt;&gt; /Users/john/Desktop/filebotmeta1.txt` ; done

That gives me a text document with this content:
net.filebot.metadata: {&quot;@type&quot;:&quot;Movie&quot;,&quot;year&quot;:1983,&quot;imdbId&quot;:85478,&quot;tmdbId&quot;:38291,&quot;language&quot;:&quot;en&quot;,&quot;id&quot;:38291,&quot;name&quot;:&quot;Educating Rita&quot;,&quot;aliasNames&quot;:[]}

But I want to return @type and it's value not the entire contents of the attribute.

I am not sure getxattr or listxattr apply to the command line. They seem to be for internal use only.
I imagine this involves outputting to a .tmp file and then grepping the contents of the file? Or, is there a one line argument I can use to print results in Terminal?
The contents look like json format.
If you could be sure the file were JSON format, there might be a better way to do this, but you'd probably need to know something of the structure of the JSON records.
However, if I understand your question correctly, I think you can get what you want with grep if you use the -o or --only-matching option (see man grep for details)
# create a string 'STRINGX' to test a regex
% STRINGX='net.filebot.metadata: {&quot;@type&quot;:&quot;Movie&quot;,&quot;year&quot;:1983,&quot;imdbId&quot;:85478,&quot;tmdbId&quot;:38291,&quot;language&quot;:&quot;en&quot;,&quot;id&quot;:38291,&quot;name&quot;:&quot;Educating Rita&quot;,&quot;aliasNames&quot;:[]}'

# try a regex that includes '&quot;@type&quot;: plus an alphanumeric string that follows
% echo $STRINGX | grep -o '\&quot;@type\&quot;:\&quot;[a-zA-Z0-9]*\&quot;'

# which yields this as output:
&quot;@type&quot;:&quot;Movie&quot;

# to print only the value of @type, one option is to use sed:
% echo $STRINGX | grep -o '\&quot;@type\&quot;:\&quot;[a-zA-Z0-9]*\&quot;' | sed 's/^.\{8\}//' 
&quot;Movie&quot; 

So - pipe your xattr -l output to the grep command as shown above.
You may be able to do a better job on the regex as I don't know if there are any rules that define characteristics such as maximum length, or presence of special characters, etc.
Let us know how this works, or if you have questions &amp; we'll try to answer.