Re: [netatalk-admins] Idea for Net printing but i need help....


Subject: Re: [netatalk-admins] Idea for Net printing but i need help....
From: Albert Max Lai (amlai@columbia.edu)
Date: Mon Jan 25 1999 - 05:45:17 EST


On Sun, 24 Jan 1999, ian reinhart geiser wrote:

>
> Okay...
> here is what i have:
>
> i wrote my script that takes in standard in and will convert it to a
> pdf file in the tmp dir.
>
> my problem is that i cannot get the information there....
>
> dose anyone know how to set up the papd.conf file so that i can
> execute the shell script. mine currently is this:
>
> nerd:\
> :pr=/etc/atalk/testpr.sh\
> :op=geiseri:

Here's your problem, you should pipe it to a script like this:

     nerd:\
         :pr=|/etc/atalk/process_ps.pl\
         :op=geiseri:

I recommend using perl roughly like this:

#!/bin/perl -w
@infile = <STDIN>;
mkdir("/tmp/$$", 0755) || die "can't make directory ($!)";

# use some sort of an outfile name

open(OUTFILE_NAME,">/tmp/$$/".$outfile_name) || die "couldnt't open the
target file: $!\n";
print OUTFILE_NAME @infile;
close(OUTFILE_NAME);

This should come close to putting a postscript file in a temp directory.
After this you should then run your shell script on this file and then
remove the file and the enclosing directory.

> my testpr.sh is as follows:
>
> #!/bin/sh
> convert $1 /tmp/foo.pdf
>
> it works when i send testpr.sh junk from stdin but when i use the pap it
> dumps core...
>
> am i going in the wrong direction.
>
> -ian reinhart geiser
>

--
Albert Lai <amlai@columbia.edu>           1018D East Campus
Residential Computer Consultant           411 W. 116th St.
Columbia University                       New York, NY 10027
http://www.columbia.edu/~aml61            (212)853-4854



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:16:15 EST