summaryrefslogtreecommitdiff
path: root/doc/mdate-sh
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-04-21 14:55:26 +0000
committerJim Meyering <jim@meyering.net>1997-04-21 14:55:26 +0000
commit39361c9d6e3c0f80fe3d9a0eb2472d1c95df5f43 (patch)
treefd6539f843bde5ea9ec636ed3956791d95f7438f /doc/mdate-sh
parent7f74dcb1a683cb353002d77d5d0b03024cb06a85 (diff)
downloadcoreutils-39361c9d6e3c0f80fe3d9a0eb2472d1c95df5f43.tar.xz
patch from Andreas S.
Diffstat (limited to 'doc/mdate-sh')
-rwxr-xr-xdoc/mdate-sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/doc/mdate-sh b/doc/mdate-sh
index e40131b3f..37171f21f 100755
--- a/doc/mdate-sh
+++ b/doc/mdate-sh
@@ -1,7 +1,7 @@
#!/bin/sh
-# mdate-sh - get modification time of a file and pretty-print it.
-# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-# Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+# Get modification time of a file or directory and pretty-print it.
+# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Prevent date giving response in another language.
LANG=C
@@ -25,14 +25,15 @@ export LC_ALL
LC_TIME=C
export LC_TIME
-# Get the extended ls output of the file.
+# Get the extended ls output of the file or directory.
+# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
if ls -L /dev/null 1>/dev/null 2>&1; then
- set - `ls -L -l $1`
+ set - x`ls -L -l -d $1`
else
- set - `ls -l $1`
+ set - x`ls -l -d $1`
fi
-# The month is at least the fourth argument.
-# (3 shifts here, the next inside the loop)
+# The month is at least the fourth argument
+# (3 shifts here, the next inside the loop).
shift
shift
shift