With test(1) you can check if a program succeeded or failed. Test is also known as [+1+NetBSD-current [(1).