Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 
share|improve this question

1 Answer

up vote 2 down vote accepted

You can use while loop:

while IFS= read -r line; do
  basex -bword="$line" searchquery.xq
done <SampleText
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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