'man osinfo-query' claims: "The exit status will be 0 if matching entries were found, or 1 if not matches were found" However: [adamw@adam tools (relabel-permissive %)]$ rpm -q libosinfo libosinfo-0.3.0-2.fc24.x86_64 [adamw@adam tools (relabel-permissive %)]$ osinfo-query os short-id=fedora24 Short ID | Name | Version | ID ----------------------+----------------------------------------------------+----------+----------------------------------------- [adamw@adam tools (relabel-permissive %)]$ echo $? 0
Patch sent to the ML: https://www.redhat.com/archives/libosinfo/2016-June/msg00066.html
commit fbe3dff28709943dcb86af433370371fe6ff7fe2 Author: Fabiano Fidêncio <fidencio> Date: Thu Jun 30 18:59:11 2016 +0200 osinfo-query: return failure when no matches are found