[x3d-public] How to leave out errors. Perhaps we can craft something for warnings.

John Carlson yottzumm at gmail.com
Sat Apr 3 21:13:38 PDT 2021


Here's how I filter out files from a file listing (files passed on 
command line of script containing this):

ls "$@" | xargs grep -lv --null \"@name\":\"error\"


If we could do something with egrep that would be cool, or we could grep 
-v \"@name\":\"warning\"


I've forgotten what --null does.


        -Z, --null
               Output a zero byte (the ASCII NUL character) instead of 
the character that normally follows a file name.  For example,
               grep  -lZ  outputs  a  zero  byte  after  each file  name 
instead of the usual newline.  This option makes the output
               unambiguous, even in the presence of file names 
containing unusual characters like newlines.  This option can be used
               with  commands  like  find  -print0,  perl  -0, sort -z, 
and xargs -0 to process arbitrary file names, even those that
               contain newline characters.


So potentially:


ls "$@" | xargs grep -lv --null \"@name\":\"error\" | xargs -0 grep -lv 
--null \"@name\":\"warning\"


This has not been tested at all, please suggest changes to 
https://github.com/coderextreme/x3dschema, files validate.sh and 
validateone.sh, by either commiting change, or creating a issue and pull 
request for tracking.

Also we need to add post filters (prior to going into a txt file) for 
development, originals, Originals, Xvl 
folders.https://github.com/coderextreme/x3dschema

Don, please forward this X3D JSON schema repository 
https://github.com/coderextreme/x3dschema to others who want to review 
X3D JSON version schemas.

I note that 3.0, 3.1, and 3.2 have the wrong title in the Schema file. 
Working on it.

Thanks,

John




More information about the x3d-public mailing list