Download this file
#!/bin/sh
# pick - script to select items. pick should be used in backquotes like this:
# rm `pick *.pl`
# or
# mv `pick` /dest
#
# Usage: To select an item, enter 'y'. To skip an item enter 'n'.
# to skip all reamining items enter 'q'. If no arguments are given
# to pick, it assumes you wish to pick through files in the current
# directory (that is, a default argument of `*' is assumed).
#
# BUGS: No effort has been made to make this script secure, it should be
# re-written in C!
#
# Written 12/2000 by Wayne Pollock, Tampa Florida USA.
LIST=''
if [ "$#" -eq 0 ]
then
set -- *
fi
while [ "$#" -gt 0 ]
do
echo -n "$1 ? " >&2
read
case "$REPLY" in
[yY]*) if [ "$LIST" = "" ]
then LIST="$1"
else LIST="$LIST $1"
fi
;;
[qQ]*) break
;;
esac
shift
done
echo "$LIST"