ilprm.icn--Interactivates the lprm command
utzoo!decvax!harpo!utah-cs!arizona!whm
utzoo!decvax!harpo!utah-cs!arizona!whm
Mon Feb 14 01:37:47 AEST 1983
#
# ilprm.icn - interactively remove jobs from line printer queue
#
# Reads the output of "lpq", printing the line for each entry and
# following it with a "? ". A response starting with a Y or y indicates
# that the entry is to be removed.
#
global rmlist
procedure main()
lp := open("/usr/ucb/lpq","rp")
line := read(lp)
if (find("is empty",line)) then
stop(line)
else
write(line)
while line := read(lp) do {
writes(line,"? ")
map(read()) ? {match("y") & zap(line)}
}
every system("lprm " || !\rmlist)
end
procedure zap(line)
initial rmlist := []
line ? {
tab(upto(' '))
tab(many(' '))
put(rmlist,tab(upto(' ')))
}
end
More information about the Comp.sources.unix
mailing list