* SUMM: Snagging Files From LPD
@ 1997-05-29 15:23 Mike Grau
0 siblings, 0 replies; only message in thread
From: Mike Grau @ 1997-05-29 15:23 UTC (permalink / raw)
To: tru64-unix-managers
Thanks to:
Richard Abraham
Alan Davis
Both suggested good things, but Alan really hit the nail with my head in
suggesting replacing the 'if' entry with a shell script that cats the
STDIN to a file.
In this case I wanted each file received from LPD to get written to it's
own individual file rather than overwriting the previous one or
appending to it. What seems to work so far is using the lock file to
generate part of the file names:
NAME=`tail -1 $LOCK | awk -F "x" '{ print $1 }'`
cat >>${DIR}${NAME}
> lpr file1.txt
> lpr file2.txt
> lpr file3.txt results in three files
and ...
> lpr file*.txt results in one file, which is what I wanted.
(For now the 'lp' entry is /dev/null)
I tried using the .seq file, but 3 "LPR's" in rapid succession would
result in the first file received getting written to it's own file and
the last two cat'ed together in one file.
I also tried using "$$" in the ksh script. Each received file was
written to its own file, but a "lpr file[1-3].txt" would also result in
three files. Also, of course, the filenames were not meaningful and you
could not "cat newfiles* >newerfile" back in the order in which they
were received.
Original question:
Are there some good ways to capture files received by the lpd daemon
from the network to individual files on disk rather than having them go
to the printer?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-05-29 15:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-29 15:23 SUMM: Snagging Files From LPD Mike Grau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox