archie/release/scripts/filter_anonftp_unix_bsd.sed
2024-05-27 20:18:02 +02:00

52 lines
1.3 KiB
Sed
Executable File

#!/bin/sh
# $Id: filter_anonftp_unix_bsd.sed,v 1.1 1995/01/11 08:03:53 lucb Exp $
# Trash leading /usr/spool/ftp from uunet
# /home/ftp/pub for xview
# ./ from aix.rpi.edu (for example)
# /bin/ls from everything
# .: from chyde.uwasa.fi (for example)
# put space between permissions and links if they bump into one another
# -rw-r--r--+ from ghost.dsi.unimi.it (lucb)
sed ' /^total[ ][ ]*[0-9][0-9]*[ ]*$/d
/^Total:[ ][ ]*[0-9][0-9]*[ ]*kbytes$/d
/^opendir:.*$/d
/^.*[ ][ ]*unreadable[ ]*$/d
s/^\.\///
s/^\/usr\/spool\/ftp\///
s/^\/pub\///
s/^\/usr\/local\/pub\///
s/^\/home\/ftp\/pub\///
s/^\/ftp\/pub\///
s/^\/com\/ftp\/pub\///
s/^\/var\/spool\/uucppublic\///
/WE ARE IN EUROPE/d
s/^\([-cbdlrwxSsTt]\{10\}\)+/\1 /
s/^\([-dl][-rwxSsTt]\{9\}.*\)\(\\$\)/\1/
s/^\([-dl][-rwxSsTt]\{9\}\)\([0-9][0-9]*\)/\1 \2/
/[cb][-rwxSsTt]\{9\}/d
/\/bin\/ls.*Permission denied$/{
N;
s/\/bin\/ls.*Permission denied[
]*//
}
/ls.*:.*Permission denied$/{
N;
s/ls.*:.*Permission denied[^ !-~]*//;
}
/\/bin\/ls.*not found$/{
N;
s/\/bin\/ls.*not found[^ ]*//
}
/.*not found$/{
N;
s/.*not found[^ ]*//
}
/can not access/d
/^[^ ]*:/{
i\
}
/^d[-rwxSsTt]\{9\}.*\/$/s/\/$//
/^\.:/d'