I wish to run a bash script that asks for a variable to be then used in a sqlite query.
I have no real experience in scripting, anyway I've tried something like the following but it doesn't work. Doesn't even give an error, just it doesn't show anything.
#!/bin/bash
echo name
read name
sqlite3 /arch.db << 'EOF'
.headers on
select type, number, address from documents where name = '$name';
EOF
I'd appreciate any help.
Asked by M.I.
(1 rep)
May 8, 2021, 04:03 PM
Last activity: Aug 16, 2022, 07:06 PM
Last activity: Aug 16, 2022, 07:06 PM