I\'ve been trying to create a simple script that will take a list of queries from a .txt file, append the main url variable, then scrape the content and output it to a text file
You've got nested quotes, try something like this:
#!/bin/bash
url=https://www.google.fr/?q=
while read query
do
content=$(curl "{$url}${query}")
echo $query
echo $content >> output.txt
done < query.txt
Use more quotes !
Try this instead :
url="example.com/?q="
for i in $(cat query.txt); do
content="$(curl -s "$url/$i")"
echo "$content" >> output.txt
done