I think in openhab2 and the exec bindnig this is not possible anymore. As the output channel of the exec binding will always be a string.
Maybe this helps.