I need to understand why I am not able to execute the following.
ls -d /data/VT60000* | xargs -IDIRECTORY find DIRECTORY -type f -iname RJ\*.xml | xargs -IFILE sh -c ' XML=$( xmlstarlet fo -D "FILE" ); EXTRACT=$( xmlstarlet sel -t -c "concat('JD',/root/item1,/root/item2)" <<< "$XML" ); echo '$EXTRACT'; '
I have a bunch of folders which contains thousands XML files. I would like to extract information from these files and then manipulate them for later processing. The reason why I am piping them is because I would like to execute multiple processes (-P)
The second xmlstarlet fails to execute and I fail to understand why.
The question is how can i achieve this.? To get a value in $EXTRACT.
Thanks for the assistance in advance.