I am attempting to create a rather simple script that zcats a gzipped file into an sqlite3 database.
prototype:
sh myscript.sh filename dbname tablename
Here's what I have so far:
#!/bin/sh
zcat $1 > tmpfile
sqlite3 $2 <<'EOF'
.separator "\t"
.import tmpfile $3
EOF
The problem is that when my import occurs, the table name is the literal "$3" instead of the desired contents of the 3rd argument.
Please show me how to do this. Bonus points for teaching me the vocabulary that I must be missing in order to find this.
I tried a bunch of search variations of the following, to no avail:
- "Command line argument literal within EOF"
- "Passing command line argument within EOF"