2

I want to execute the following instruction:

basex -bword=ENTRY consulta.xq

But for every line of a SampleText file (plain text mainly).

The SampleText contains the following lines:

hello
evening
courageous
...
happy

So more or less what I want to do is to execute a instruction in a one liner recipe similar to this:

cat SampleText | basex -bword=EACHLINE searchquery.xq 
3

You can use while loop:

while IFS= read -r line; do
  basex -bword="$line" searchquery.xq
done <SampleText

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.