On Fri, Nov 30, 2001 at 03:08:16PM -0500, Kairam, Raj wrote:
> In my perl script I have a line like this.
> system( "'/usr/bin/lp -dhp4si /tmp/plotreq.txt' > /tmp/plotid.txt");
>
> hp4si is the destination printer.
> /tmp/plotreq.txt is small text file to be sent to the printer.
> /tmp/plotid.txt is the output of lp command ( just one line to indicate job
> id )to be saved.
>
> If I run the command /usr/bin/lp -dhp4si /tmp/plotreq.txt > /tmp/plotid.txt
> it is fine as a command line.
>
> The same in the perl script as above, doesn't send the file to printer nor
> does it create the /tmp/plotid.txt file.
>
> I have tried this also and did not work.
> @lplist = ("/usr/bin/lp", "-dhp4si /tmp/plotreq.txt");
You're using system incorrectly; this should work:
system "/usr/bin/lp -dhp4si /tmp/plotreq.txt > /tmp/plotid.txt"; # no singlequotes
arounf the command
-Balazs