File: arch_trunc

package info (click to toggle)
smartlist 3.15-28
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,308 kB
  • sloc: ansic: 9,238; sh: 4,901; makefile: 118
file content (20 lines) | stat: -rwxr-xr-x 456 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/sh
:
#$Id: arch_trunc,v 1.10 1999/12/17 07:04:47 guenther Exp $

echo=echo		# /bin/echo
ls=ls			# /bin/ls
sed=sed			# /bin/sed
rm=rm			# /bin/rm

if cd archive/$archive_dir
then
  case "$ARCHIVE" in	# do not start removing every time, to decrease load
     *[248])
	$rm -f _dummy_ \
	 `$ls -t | $sed -n -e '/^[0-9]/ p' | $sed -e '1,'$archive_hist' d'` ;;
  esac
else
  $echo "Don't start this script directly, it is used in rc.submit"
  exit 64
fi