cat > /home/user/Guthaben.sh
#!/bin/sh # simple query to the RTCOM database: # - selects the last incoming SMS beginning with the string "Ihr Guthaben" # - formats the output to only display date and account balance in € sqlite3 -separator ": " /home/user/.rtcom-eventlogger/el.db \ "SELECT strftime('%d.%m.%Y',storage_time,'unixepoch','localtime'), free_text FROM Events WHERE event_type_id = '7' AND free_text LIKE 'Ihr Guthaben%' ORDER BY end_time DESC LIMIT 1"\ | sed s/Ihr.*gt\ // | sed s/.EUR./€/
chmod u+x /home/user/Guthaben.sh
/home/user/Guthaben.sh <enter>