I got values in a file that needs to read and added to a command. This is my failing solution...
for arrayValue in "${fileArray[@]}"
do
curl -s --user "${arrayValue[0]}:${arrayValue[1]}" "https://dyndns.loopia.se?hostname=$arrayValue
done
The file is like this:
username
password
domain
domain
...
Reading from the file is no problem, the problem is how to add them to the curl command.
fileArray=( < yourfile )? Show the output ofdeclare -p fileArray. (before the loop). And, what is the end yourcurlcommand, e.g."https://dyndns.loopia.se?hostname=$arrayValue..."?curl -s --user "${arrayValue[0]}:${arrayValue[1]}"should becurl -s --user "${fileArray[0]}:${fileArray[1]}"