The R Project SVN R

Rev

Rev 37959 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37959 Rev 44851
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# Get modification time of a file or directory and pretty-print it.
2
# Get modification time of a file or directory and pretty-print it.
3
 
3
 
4
scriptversion=2005-06-29.22
4
scriptversion=2007-03-30.02
5
 
5
 
6
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
6
# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software
7
# Foundation, Inc.
7
# Foundation, Inc.
8
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
8
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
9
#
9
#
10
# This program is free software; you can redistribute it and/or modify
10
# This program is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
11
# it under the terms of the GNU General Public License as published by
Line 73... Line 73...
73
if ls -L /dev/null 1>/dev/null 2>&1; then
73
if ls -L /dev/null 1>/dev/null 2>&1; then
74
  ls_command='ls -L -l -d'
74
  ls_command='ls -L -l -d'
75
else
75
else
76
  ls_command='ls -l -d'
76
  ls_command='ls -l -d'
77
fi
77
fi
-
 
78
# Avoid user/group names that might have spaces, when possible.
-
 
79
if ls -n /dev/null 1>/dev/null 2>&1; then
-
 
80
  ls_command="$ls_command -n"
-
 
81
fi
78
 
82
 
79
# A `ls -l' line looks as follows on OS/2.
83
# A `ls -l' line looks as follows on OS/2.
80
#  drwxrwx---        0 Aug 11  2001 foo
84
#  drwxrwx---        0 Aug 11  2001 foo
81
# This differs from Unix, which adds ownership information.
85
# This differs from Unix, which adds ownership information.
82
#  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
86
#  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
Line 87... Line 91...
87
# will be owned by a user whose name is a month.  So we first look at
91
# will be owned by a user whose name is a month.  So we first look at
88
# the extended ls output of the root directory to decide how many
92
# the extended ls output of the root directory to decide how many
89
# words should be skipped to get the date.
93
# words should be skipped to get the date.
90
 
94
 
91
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
95
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
92
set x`ls -l -d /`
96
set x`$ls_command /`
93
 
97
 
94
# Find which argument is the month.
98
# Find which argument is the month.
95
month=
99
month=
96
command=
100
command=
97
until test $month
101
until test $month