Running command on each line in file Running command on each line in file shell shell

Running command on each line in file


You can use xargs:

xargs < FramesList.txt -n 1 xmlstartet#       ^               ^   ^#       |               |   Command to run#       |               Max number of arguments (xmlstartet will be called for#       |               each line in input file)#       Input file


while  read -r linedoxmlstarlet "$line"done <FramesList.txt


I think most XML Starlet commands accept more than one file as a parameter, and since your input list is small, you could also write

xml COMMAND $(<FramesList.txt)