I would suggest you save the column of queries in text file in your HOME directory - probably using copy and paste and call it queries.txt
. Let's imagine it looks like this:
Why do 24-hr gas stations have locks on their doors?
Why don't they make planes out of the same material as the indestructible black boxes?
If nothing sticks to Teflon, how do they stick it to the pan?
Then, I would save the following as runQueries
in your HOME directory:
#!/bin/bash
while read query; do
echo Running query $query...
esearch -db pubmed -query "$query" | efetch -format docsum | xtract -pattern DocumentSummary ...
done < queries.txt
Then you can run this once in Terminal to make the script executable:
chmod +x runQueries
And then you can run it as many times as you like, using this each time:
./runQueries
Sample Output
Running query Why do 24-hr gas stations have locks on their doors?...
esearch -db pubmed -query Why do 24-hr gas stations have locks on their doors? ...
Running query Why don't they make planes out of the same material as the indestructible black boxes?...
esearch -db pubmed -query Why don't they make planes out of the same material as the indestructible black boxes? ...
Running query If nothing sticks to Teflon, how do they stick it to the pan?...
esearch -db pubmed -query If nothing sticks to Teflon, how do they stick it to the pan? ...