symbolic links take on user ownership of their containing directory
[unix-history] / usr / src / usr.bin / compress / usermem.sh
index b3741ba..336eca5 100644 (file)
@@ -1,6 +1,25 @@
 #!/bin/sh -
 #
 #!/bin/sh -
 #
-#      @(#)usermem.sh  5.3 (Berkeley) %G%
+# Copyright (c) 1985 The Regents of the University of California.
+# All rights reserved.
+#
+# This code is derived from software contributed to Berkeley by
+# James A. Woods, derived from original work by Spencer Thomas
+# and Joseph Orost.
+#
+# Redistribution and use in source and binary forms are permitted
+# provided that the above copyright notice and this paragraph are
+# duplicated in all such forms and that any documentation,
+# advertising materials, and other materials related to such
+# distribution and use acknowledge that the software was developed
+# by the University of California, Berkeley.  The name of the
+# University may not be used to endorse or promote products derived
+# from this software without specific prior written permission.
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+#
+#      @(#)usermem.sh  5.6 (Berkeley) %G%
 #
 : This shell script snoops around to find the maximum amount of available
 : user memory.  These variables need to be set only if there is no
 #
 : This shell script snoops around to find the maximum amount of available
 : user memory.  These variables need to be set only if there is no
@@ -33,9 +52,10 @@ then
 fi
 
 SIZE=0
 fi
 
 SIZE=0
-if test -r /usr/adm/messages   # probably the most transportable
+# messages: probably the most transportable
+if test -r /var/log/messages -a -s /var/log/messages
 then
 then
-    SIZE=`grep avail /usr/adm/messages | sed -n '$s/.*[        ]//p'`
+    SIZE=`grep avail /var/log/messages | sed -n '$s/.*[        ]//p'`
 fi
 
 if test 0$SIZE -le 0           # no SIZE in /usr/adm/messages
 fi
 
 if test 0$SIZE -le 0           # no SIZE in /usr/adm/messages