On Mon, Jun 20, 2016 at 10:39 PM, Andy Seaborne <a...@apache.org> wrote:
>
> Shell magic are be applied:
>
> capture the output and test it.
>
> If in a subshell, the exit here will set the out $?
>
> -------------
> #!/bin/bash
>
> (
>    X="$(riot --validate ... 2&>1)"
>    if [[ -n "$X" ]]
>    then
>       exit 99
>    fi
> )
> echo $?
> -------------


Yes. I'm already using a similar approach to validate Turtle files:

find . \
     -type f \
     -name "*.ttl" e
     -exec sh \
     -c 'if [[ $(riot --validate "{}" 2>&1) ]]; then echo "{}"; fi' \;

I was just thinking if there is simpler way.

- Jindřich

Reply via email to