source: gpfs_3.1_ker2.6.20/lpp/mmfs/samples/util/tslistall @ 16

Last change on this file since 16 was 16, checked in by rock, 16 years ago
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/ksh
2# IBM_PROLOG_BEGIN_TAG
3# This is an automatically generated prolog.
4
5
6
7# Licensed Materials - Property of IBM
8
9# (C) COPYRIGHT International Business Machines Corp. 2002,2004
10# All Rights Reserved
11
12# US Government Users Restricted Rights - Use, duplication or
13# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
14
15# IBM_PROLOG_END_TAG
16
17#############################################################################
18#
19# Usage:  tslistall <pathname> [<tmpdirname>]
20#
21#############################################################################
22
23# Verify caller provided the pathname
24if [[ $# -lt 1 ]]
25then 
26    print -u2 "Usage: $0 pathname [<tmpdirname>]";
27    exit 1;
28fi
29path="$1"
30tmpdir=${2:-"/tmp"}
31
32# Generate a temporary file name
33
34tmpFile1="$tmpdir/tssave".$$."a"
35
36# Read the directory structure and sort it into the tmp file
37tsreaddir "$path" | sort -T "$tmpdir" > "$tmpFile1" || exit
38
39# Get the file's mtime/ctime and merge it with the file names
40# note: tab character between the quotes
41tstimes "$path" | join -t'  ' - "$tmpFile1"
42
43# Save return code and delete the temp file before returning
44rc=$?
45rm -f "$tmpFile1"
46exit $rc
Note: See TracBrowser for help on using the repository browser.