yapp_query dev1 ...
       yapp_query png ps
       
would return the first device that is available. Here’s an example of usage:
 
       dev=$(yapp_query png ps)
       tabplot 1.tab yapp=fig1.$dev/$dev
would be a more portable way. This is a common situation, where on redhat
based system the png driver is not installed, but on debian based it is
(in 2021). 
2021 Created PJT