Testsuite: more portable implementation of "showenv"
authorJeremy Harris <jgh146exb@wizmail.org>
Fri, 24 Oct 2014 10:12:20 +0000 (11:12 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Fri, 24 Oct 2014 10:12:20 +0000 (11:12 +0100)
At least one Solaris installation seems not to have "whoami"

test/aux-fixed/showenv

index a49833adab3d9d0e201eeae3a2cea405c8a3c6fd..5d9ef8f8a34e05ea47fb6b643cd31a8e83c197ea 100755 (executable)
@@ -3,8 +3,10 @@
 # This script outputs certain information about the environment, for use when
 # testing pipe transports.
 
+name=`whoami 2>/dev/null` || name=`who . . | awk '{print $1}'`
+
 echo Test pipe script
-echo Running as: `whoami`
+echo Running as: $name
 echo ------------------
 echo Args:
 while [ "$1" != "" ]; do