sorry for the noob question. I'm trying to write a simple bash script, based on newsbeuter. Basically I'm trying to get the first 5 articles I haven't read yet, once I got them, I send them to my phone with pushover and I need so set them as read on newsbeuter.
#!/bin/bash --
urls=$( sqlite3 /home/pi/.newsbeuter/cache.db <<END
select url from rss_item where unread = 1 limit 5;
END
)
This is the first query. I send the message variable through the pushover api. Now I need to get how to update the table and set the articles as read. Any ideas? (I'm totally new to bash syntax). I tried both to recreate a query like
UPDATE rss_item set unread = 0 where url = '$url'
I looped it but it didn't work, then I tried to make
`UPDATE rss_item set unread = 0 where url in ($urls)`
but I keep getting errors I can't even understand! I really need a syntax lecture!
echo $message). If you protect$messageby simple quotes in bash, it won't be interpreted: you'll get$messageliterally in the query.UPDATE rss_item set unread = 0 where url = '$message'query, what would you type? (edit your question it will be better)$urlsin quotes? if$urlsis equal tobob, alice, sallythat won't work, you'd need it to be something like'bob', 'alice', 'sally'