function sd-add set cardfile cards set idx (math 1+(sqlite3 "$cardfile" "select max(idx) from cards")) sqlite3 "$cardfile" "insert into cards values ($idx, 256, '$argv[1]', '$argv[2]')" end