My current code is
#! /bin/sh
yday=$(/usr/bin/date --date="yesterday" +"%Y-%m-%d")
outfile='/var/www/api.example.com/seb/imports/'${yday}'.csv'
infile="https://example.com/export/vendors?lower_date=${yday}&higher_date=${yday}"
echo $outfile
echo $infile
The output is
.csvr/www/api.example.com/seb/imports/2022-01-06
&higher_date=2022-01-06com/export/vendors?lower_date=2022-01-06
Also tried as
outfile=$("/var/www/api.example.com/seb/imports/$yday.csv")
and
outfile=$('/var/www/api.example.com/seb/imports/'${yday}'.csv')
These generate
.csv: not found.example.com/seb/fetch_csv.sh: 3: /var/www/apidev.example.com/seb/fetch_csv.sh: /var/www/api.example.com/seb/imports/2022-01-06
The intended use of the variables is in /usr/bin/wget -q -O $outfile $infile
How do I get the intended path and url correctly interpolated into my variables?