so, answering my own question thanks to your input, here is the bash one-liner, wrapped into a script for easy insertion of the parameter, which returns the name of a rule by it’s id:
#!/bin/bash
echo `ssh -p 8101 openhab@localhost smarthome:automation listRules|grep $1| awk '{print $3}'`
(to avoid the password dialog I configured private/public key access to karaf following Remove openhab password )