projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
date and time created 84/07/31 12:40:08 by pc
[unix-history]
/
usr
/
src
/
local
/
ukc
/
dump
/
cleanvolumes.sh
#!/bin/sh
# cleanvolumes.sh 1.1 %G%
# shell script to clean dumplog file
#
# Name of logfile
DL
=
dumplog
# Name of tmp files
DT
=/
tmp
/
dumpclean$$
DE
=/
tmp
/
dumpedit$$
trap
"rm -f
$DT
$DE
"
1 2 3 15
sed
-e
's/:.*$//'
$DL
|
sort
|
uniq
-c
|
awk
'{ if (
$1
!= 1)
{
for (i = 0; i <
$1
-1; i++)
printf "1
\n
/%s/d
\n
",
$2
}
}'
>
$DE
if
[
-s
$DE
]
then
cp
$DL $DT
echo
"w"
>>
$DE
echo
"q"
>>
$DE
ed
$DT
<
$DE
> /
dev
/
null
fi
mv
$DT $DL
rm
$DE