I don't use what often, but I do use it sometimes.  Today I noticed
the format of what's output on OpenBSD was different than that of what
on FreeBSD.
Looking in what.1:
https://man.openbsd.org/what
I noticed OpenBSD's what is documented as abiding by POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/what.html
Thus, the following output:

tewi$ what /usr/bin/lorder
/usr/bin/lorder
        $OpenBSD: lorder.sh,v 1.15 2015/07/03 11:43:55 jca Exp $
        lorder.sh       8.1 (Berkeley) 6/6/93

is missing a single colon after the name/path/argument.
After applying the attached diff, the output is:

tewi$ ./what /usr/bin/lorder
/usr/bin/lorder:
        $OpenBSD: lorder.sh,v 1.15 2015/07/03 11:43:55 jca Exp $
        lorder.sh       8.1 (Berkeley) 6/6/93

Hope this helps!  Of course, if there's a reason the : is omitted,
that's fine too.
? whatcdiff.txt
Index: what.c
===================================================================
RCS file: /cvs/src/usr.bin/what/what.c,v
retrieving revision 1.15
diff -u -p -r1.15 what.c
--- what.c      9 Oct 2015 01:37:09 -0000       1.15
+++ what.c      18 Apr 2020 07:55:29 -0000
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
                        perror(*argv);
                        exit(matches ? 0 : 1);
                }
-               printf("%s\n", *argv);
+               printf("%s:\n", *argv);
                search(match);
        } while(*++argv);
        exit(matches ? 0 : 1);

Reply via email to