<div dir="ltr"><div class="gmail_default" style="font-family:'courier new',monospace">Russell</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">
There is no way to shorten the test that I am aware of.</div><div class="gmail_default" style="font-family:'courier new',monospace">The ">" indicates the level of the test, so I ma thinking that you should be use an extra ">" when you get to the 3rd test</div>
<div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">ie:</div><div class="gmail_default" style="font-family:'courier new',monospace">
<br></div><div class="gmail_default" style="font-family:'courier new',monospace"><span style="font-family:arial,sans-serif;font-size:13px">0 beshort 0xfe01 MySQL table definition file</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">>2 byte x Version %d,</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">>>3 byte 9 Type MYISAM</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">>>3 byte 12 Type INNODB</span><br></div><div class="gmail_default" style="font-family:'courier new',monospace">
<br>
</div><div class="gmail_default" style="font-family:'courier new',monospace">The first test identifies it as a SQL table file</div><div class="gmail_default" style="font-family:'courier new',monospace">The second test displays the version</div>
<div class="gmail_default" style="font-family:'courier new',monospace">The 3rd test displays the Type</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace">
You will need one line for each type</div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace"><br></div>
<div class="gmail_default" style="font-family:'courier new',monospace">
<br></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><font face="'courier new', monospace"><br></font></div><font face="'courier new', monospace"><div><font face="'courier new', monospace">Cheers</font></div>
<div><font face="'courier new', monospace"><br></font></div>----------------------------------------------------------<br>Chris Martin<br>m: +61 419 812 371</font><div><font face="'courier new', monospace">e: chris@martin.cc<br>
----------------------------------------------------------<br></font><div><font face="'courier new', monospace"><br></font></div></div></div></div>
<br><br><div class="gmail_quote">On 15 June 2014 21:20, Russell Coker <span dir="ltr"><<a href="mailto:russell@coker.com.au" target="_blank">russell@coker.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've got an enum in a data structure that I'd like to display in the output of<br>
file(1).<br>
<br>
0 beshort 0xfe01 MySQL table definition file<br>
>2 byte x Version %d,<br>
>3 byte 9 Type MYISAM<br>
>3 byte 12 Type INNODB<br>
<br>
The above is a sample of what I'm doing, values 9 and 12 in byte 3 correspond<br>
to MYISAM and INNODB entries for the MySQL FRM file.<br>
<br>
<a href="https://github.com/twitter/mysql/blob/master/sql/handler.h" target="_blank">https://github.com/twitter/mysql/blob/master/sql/handler.h</a><br>
<br>
The above URL has what seems to be a complete list, so I could write 31 lines<br>
in /etc/magic for this, but that's ugly. Is there a way I can specify a list<br>
of values to match followed by a list of strings to display and not have 31<br>
lines?<br>
<br>
I'd like to develop a patch that can be accepted into the Debian package and<br>
hopefully upstream so it has to be the least ugly way of doing it.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
My Main Blog <a href="http://etbe.coker.com.au/" target="_blank">http://etbe.coker.com.au/</a><br>
My Documents Blog <a href="http://doc.coker.com.au/" target="_blank">http://doc.coker.com.au/</a><br>
<br>
<br>
_______________________________________________<br>
linux-aus mailing list<br>
<a href="mailto:linux-aus@lists.linux.org.au">linux-aus@lists.linux.org.au</a><br>
<a href="http://lists.linux.org.au/listinfo/linux-aus" target="_blank">http://lists.linux.org.au/listinfo/linux-aus</a><br>
</font></span></blockquote></div><br></div>