This is bash script
#!/bin/sh
filename=$1
path=data/$filename/$filename.csv
echo $path
aws s3 cp s3://bucket/key/$filename.csv $path
we written it for based on input parameter (filename), read the file from s3 bucket and move to our local directory. for example sh demo.sh sales
. it will copy sales.csv file from source s3 bucket to local directory data/sales/sales.csv.
when we execute the command , it is showing some wired output like this .csvsales
. but my expectation is data/sales/sales.csv. I tried ${filename},$filename and add double /. no luck,. But one think observed is if have this line
path=data/$filename/
and do echo it is printing data/sales. if i add additional string '/$filename.csv' it is not showing expected output.