How can I write commands like the following?
apps: myrootapp: command: "[[ $EUID -ne 0 ]] && echo 'This command needs root' || bin/myapp"
I currently get the following error:
Failed to generate snap metadata: The specified command "[[ $EUID -ne 0 ]] && echo 'This command needs root' || bin/myapp" defined in the app 'myrootapp' does not match the pattern expected by snapd. The command must consist only of alphanumeric characters, spaces, and the following special characters: / . _ # : $ -
If not possible, what other approach do you suggest? If possible, I would like to avoid creating a separate script for such simple logic