by gniv · 3y ago · 0 comments
curl -s https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip | funzip | sqlite3 -csv ':memory:' '.import /dev/stdin stdin' "select Date,USD from stdin order by USD asc limit 1;" # !/bin/bash
ARG1=${1:-'select Date from stdin order by USD asc limit 1;'}
curl -o - -Ls https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip \
| funzip | sqlite3 -csv ':memory:' '.import /dev/stdin stdin' "${ARG1}"
# Usage:
$ ./run.sh 'select * from stdin limit 1;'