home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / utils / file / logiso.000 / logiso / Utils / RCS / find_links,v < prev    next >
Encoding:
Text File  |  1995-03-24  |  1.7 KB  |  118 lines

  1. head    1.4;
  2. access;
  3. symbols
  4.     VER_0_3:1.4
  5.     VER_0_2:1.3;
  6. locks; strict;
  7. comment    @# @;
  8.  
  9.  
  10. 1.4
  11. date    95.03.24.11.43.35;    author coulter;    state Exp;
  12. branches;
  13. next    1.3;
  14.  
  15. 1.3
  16. date    95.03.10.02.42.22;    author coulter;    state Exp;
  17. branches;
  18. next    1.2;
  19.  
  20. 1.2
  21. date    95.02.19.16.06.41;    author coulter;    state Exp;
  22. branches;
  23. next    1.1;
  24.  
  25. 1.1
  26. date    95.02.18.12.29.58;    author coulter;    state Exp;
  27. branches;
  28. next    ;
  29.  
  30.  
  31. desc
  32. @Script to find link files below a given directory.
  33. @
  34.  
  35.  
  36. 1.4
  37. log
  38. @Checkin version for 0.3 distribution.
  39. @
  40. text
  41. @#! /bin/ksh
  42. USAGE='USAGE: find_links [ ROOT_DIR ]
  43.     Print to stdout lines with FILE_PATH and LINK for every
  44.     link on the hard disk.
  45. '
  46. # (C) Copyright 1995 by Michael Coulter.  All rights reserved.
  47.  
  48. # Process parameters
  49.  
  50.    if [ $# -gt 1 ]
  51.    then
  52.       echo "$USAGE" >&2
  53.       echo "Too many arguments." >&2
  54.       exti 1
  55.    fi
  56.    ROOT_DIR="/"
  57.    if [ $# -gt 0 ]
  58.    then
  59.       ROOT_DIR="$1"; shift
  60.    fi
  61.    if [ ! -d "$ROOT_DIR" ]
  62.    then
  63.       echo "$USAGE" >&2
  64.       echo "$ROOT_DIR is not a directory" >&2
  65.       exti 1
  66.    fi
  67.  
  68. # Do find
  69.  
  70.    find  ${ROOT_DIR}                       \
  71.          -path '/mnt/*' -prune                 \
  72.       -o -path '/cdmnt/*' -prune                  \
  73.       -o -path '/tmp/*' -prune                  \
  74.       -o -path '/proc/*' -prune                \
  75.       -o -path '/var/tmp/*' -prune                \
  76.       -o -path '/var/utmp/*' -prune                \
  77.       -o -type l
  78. @
  79.  
  80.  
  81. 1.3
  82. log
  83. @Checkin files modified to make version 0.2
  84. @
  85. text
  86. @d6 1
  87. @
  88.  
  89.  
  90. 1.2
  91. log
  92. @Checkpoint version 0.1
  93. @
  94. text
  95. @d31 1
  96. @
  97.  
  98.  
  99. 1.1
  100. log
  101. @Initial revision
  102. @
  103. text
  104. @d2 1
  105. a2 1
  106. USAGE='USAGE: find_links
  107. d7 29
  108. a35 8
  109. .do find /                                \
  110.           -path '/mnt/*' -prune                 \
  111.        -o -path '/tmp/*' -prune                  \
  112.        -o -path '/proc/*' -prune                \
  113.        -o -path '/system_cd/*' -prune              \
  114.        -o -path '/var/tmp/*' -prune                \
  115.        -o -path '/var/utmp/*' -prune                \
  116.        -o -type l
  117. @
  118.