How to batch execute a command to a specific set of files inside a directory and redirect the output of each run to an individual file.
ls *.264 | xargs -t -I{} sh -c "./ldecod.exe -i '{}' -o /dev/null > 'out{}.txt'"
The first ls *.264 will list all .264 files and pipe them to xargs which will execute the ./ldecod.exe replacing '{}' by each element from the ls *.264
2 comments:
thank you for your help! Needed it for this:
virsh list | grep -v Name | grep -v "\-\-\-" | cut -c8-20 | sed 's/ //g' | xargs -t -I{} sh -c "virsh dumpxml '{}' > '{}.xml'"
Post a Comment