NP.
Essentially, you just invoke mktemp
and it creates a file and returns that file's name. So you can use it anywhere you'd use a hard-coded file name.
So by doing WFILE=$(mktemp)
you get something like /tmp/tmp.CqOZSJZb5y
in your WFILE
variable. So where you deal with wfile it would look something like this:
WFILE=$(mktemp)
curl -f -s https://wex.nz/api/3/ticker/"${tickerswex[i]}" > "${WFILE}"
w=$(cat "${WFILE}" | jq '.'"${tickerswex[i]}"'.sell')
wv=$(cat "${WFILE}" | jq '.'"${tickerswex[i]}"'.vol')
rm "${WFILE}"
You could do it for wfile, yfile, efile...
Sorry if I over-explained that.