#!/bin/sh
# Created by Ben Okopnik, 1/2001
# Removes all the files in current dir except the specified ones.
# "filespec" must be a single string that specifies either one file or a
# list via wildcards.

[ -z "$1" ] && { printf "Syntax: rmx '<filespec>'\n"; exit; }

pick=`/bin/ls -AF1|grep -v /$|grep -v $1`

printf "The following files will be deleted:\n\n$pick\n\n"
printf "Press 'Enter' to delete, Ctrl-C to quit:"
read

rm $pick