home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
OL.LZH
/
PROGS.LZH
/
GCOMP.ICN
< prev
next >
Wrap
Text File
|
1991-07-13
|
1KB
|
42 lines
############################################################################
#
# Name: gcomp.icn
#
# Title: Produce complement of file specification
#
# Author: William H. Mitchell, modified by Ralph E. Griswold
#
# Date: December 27, 1989
#
############################################################################
#
# This program produces a list of the files in the current directory
# that do not appear among the arguments. For example,
#
# gcomp *.c
#
# produces a list of files in the current directory that do
# not end in .c. As another example, to remove all the files
# in the current directory that do not match Makefile, *.c, and *.h
# the following can be used:
#
# rm `gcomp Makefile *.c *.h`
#
# The files . and .. are not included in the output, but other
# `dot files' are.
#
############################################################################
#
# Requires: UNIX
#
############################################################################
procedure main(args)
local files
files := set()
read(open("echo * .*","rp")) ? while insert(files,tab(upto(' ') | 0)) do
move(1) | break
every delete(files,"." | ".." | !args)
every write(!sort(files))
end