Sysfs to control GPIO depracted -> Alternatives?

Why does:

if [ "$(gpioget --chip 0 31)" == '"31"=active' ] ; then
  echo execute some commands
fi

not work for you?