Execute a terminal command in openhab

I need to run some commands of debian’s terminal in openhab. I think I should use the addon binding.exec
For example to turn on an LED from debian terminal I will write:
sudo echo 1 > /sys/class/gpio_sw/PA7/data
so I created the following file .items:
Switch RaspiLED {exec=">[ON:sudo echo 1 > /sys/class/gpio_sw/PA7/data] >[OFF:sudo echo 0 > /sys/class/gpio_sw/PA7/data]"}

but I have not been successful. Did I do something wrong?
thank you

Hi Federico,

There are odd spaces in your example item, so it’s hard to tell if this is the actual item definition, or a formatting problem. Could you confirm the exact item definition?

Aside from that, you may have problems with using sudo this way, depending on other configuration and under which user the openHAB server is running. Would it be possible to allow write permission by the openhab user to /sys/class/gpio_sw/PA7/data and thus drop the use of sudo?

Someone else who knows GPIO on RPi might have much better advice than the above!