I compiled Android 8.1 from source code.
$ adb shell getprop ro.build.version.release
8.1.0
$ adb shell
angler:/ $ su -c date
su: invalid uid/gid '-c'
1|angler:/ $ su --help
usage: su [UID[,GID[,GID2]...]] [COMMAND [ARG...]]
Switch to WHO (default 'root') and run the given command (default sh).
where WHO is a comma-separated list of user, group,
and supplementary groups in that order.
Various resources, including https://stackoverflow.com/a/10038568/746461, https://android.stackexchange.com/q/201680/97993, seem to indicate su
has option -c
. However my android doens't have.
What could be the reason?