Peter Pilsl wrote:> > I use smbprint to print to remote nt-printers. In new samba2.2 and the > smb-tng this doesnt work any more .. > > cat file | smbclient \\\\server\printer pass -U user -N > > brings a lot of errors, cause smbclient interpretes all the file as > smbclient-commands. > > I used the new 2.2 smbprint-scripts and this uses the above mechanism and therefore doesnt work. > To print, I have to connect via smbclient and the perform a put-command, which is different approach. > > The smbprint is an old script that still uses the -P option that seems to be already gone ... > > please help, > peter >I use system 5 printing so your mileage may vary. The command that gets executed by my interface script is cat file | /usr/samba/bin/smbclient //controller/deskjet -Uuser -N -c 'print -'
I use smbprint to print to remote nt-printers. In new samba2.2 and the smb-tng this doesnt work any more .. cat file | smbclient \\\\server\printer pass -U user -N brings a lot of errors, cause smbclient interpretes all the file as smbclient-commands. I used the new 2.2 smbprint-scripts and this uses the above mechanism and therefore doesnt work. To print, I have to connect via smbclient and the perform a put-command, which is different approach. The smbprint is an old script that still uses the -P option that seems to be already gone ... please help, peter -- mag. peter pilsl phone: +43 676 3574035 fax : +43 676 3546512 email: pilsl@goldfisch.at sms : pilsl@max.mail.at pgp-key available
> I use smbprint to print to remote nt-printers. In new samba2.2 and the > smb-tng this doesnt work any more .. > > cat file | smbclient \\\\server\printer pass -U user -Ntry: (echo "print -" ; cat file ) | smbclient ..... Works for me on 2.0.7 which doesn't use the -P according to the man page, but gives no errors with it and reports it with -h. Christian _______________________________________________________________________ In a world without walls and fences, who needs windows and gates? (SUN)
Angie.Cabrera@LogixCom.com
2001-May-08 00:01 UTC
smbprint (or: print to nt with smbclient)
I am having the same issue. I am running Linux Red Hat V7.0 and Samba 2.2.0. I am simply trying to print to a printer on an NT server. I have tried : cat file | smbclient \\\\server\printer -U user%password But this does not work it gets me to the smb prompt and interprets the first word of my file as an undefined smb command. I have tried: cat file | smbclient \\\\server\printer -Uuser%password -c 'print -' This does the same thing. smbclient \\\\server\printer -Uuser%password -c 'print file' Which does not print the file at all. And I have tried (echo "print -" ; cat file ) | smbclient ..... Which does not print the file at all either. Samba is working as far as shares are concerned, etc. I know I can talk to the printer because I am getting blank pages and error handler pages. I just can't seem to figure out the correct syntax. help!
Angie.Cabrera@LogixCom.com
2001-May-09 00:45 UTC
smbprint (or: print to nt with smbclient)
I can connect to the drive shares without any trouble. And I can connect to the printer share because I get to the smb> prompt. The syntax I am using does not pass the file as a file to print but as commands. Oh course it does not recognize the commands. And you are right about the slashes, that's just a habit. I tried the -W and that didn't work. For example my test file has "This is a test file." as its content. I type: cat file | smbclient \\\\server\printer -U user%password And receive back : added interface ip=172.31.44.5 bcast=172.31.44.255 nmask=255.255.255.0 Domain=[LOGIX] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0] smb: \> This is a test file. This: command not found smb: \> So it looks like it's connecting.....help. -----Original Message----- From: Christian Barth [mailto:barth@cck.uni-kl.de] Sent: Tuesday, May 08, 2001 12:43 AM To: samba@lists.samba.org; Cabrera, Angie Subject: Re: smbprint (or: print to nt with smbclient)> I am having the same issue. I am running Linux Red Hat V7.0 and Samba > 2.2.0. I am simply trying to print to a printer on an NT server. > > I have tried : > cat file | smbclient \\\\server\printer -U user%password > But this does not work it gets me to the smb prompt and interprets thefirst> word of my file as an undefined smb command. > I have tried: > cat file | smbclient \\\\server\printer -Uuser%password -c 'print -' > This does the same thing. > smbclient \\\\server\printer -Uuser%password -c 'print file'One (or more) of your combinations should do it. But with smbclient \\\\server\\printer ... (2 \ in fornt of the server, each one escaped form the shell, that are 4; 1 \ between server and share, escaped form the shell that are 2). But with recend versios von smbclient it should work as smbclient //server/printer May try the -W parameter as well. Can you connet to the printer, or any share on the server with smbclient interactivly? Christian> Which does not print the file at all. > And I have tried > (echo "print -" ; cat file ) | smbclient ..... > Which does not print the file at all either. > > Samba is working as far as shares are concerned, etc. I know I can talkto> the printer because I am getting blank pages and error handler pages. I > just can't seem to figure out the correct syntax. help! > > > > > > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba >_______________________________________________________________________ In a world without walls and fences, who needs windows and gates? (SUN)
Angie.Cabrera@LogixCom.com
2001-May-09 20:46 UTC
smbprint (or: print to nt with smbclient)
You are absolutely right that worked!!! My printer is an HP Laserjet 8000 and it accepts both plain text and postscript files. Is there a way with samba or the printer to specify a plain text file, because it seems to thinks it's a postscript and I don't know if samba or the printer is doing that? Let's say I use plain old unix and type lp /tmp/test. The text file prints just fine to same printer. So it makes me think it's something samba is doing?? -----Original Message----- From: Herb Lewis [mailto:herb@chomps.engr.sgi.com] Sent: Wednesday, May 09, 2001 2:06 PM To: Cabrera, Angie Subject: Re: smbprint (or: print to nt with smbclient) Angie.Cabrera@LogixCom.com wrote:> > I tried this: > > [acabrera@cds acabrera]$ cat /tmp/test | smbclient\\\\r1hou1f2\\hou1_11_cs2> -U acabrera%password -c 'print -' > added interface ip=172.31.44.5 bcast=172.31.44.255 nmask=255.255.255.0 > Domain=[LOGIX] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0] > putting file - as stdin-1340 (0.3 kb/s) (average 0.3 kb/s) > > And got this from the printer: > > Psotscript Error Handler > > Offending Command = This > Error = nametype : undefined > Stack > > The contects of /tmp/test is "This is a test file" > > So even though it looks like it is taking the file it is still trying touse> the contents as commands instead of printing them. >You now have a different error. The file is making it to the printer now and the printer objects because it is not a postscript file. Just to be sure change your test file to contain the following small postscript page. If this prints correctly your printer only accepts postscript input so you will have to preprocess text files with a standard print filter. %! 36 36 scale /Helvetica findfont setfont 2 20 moveto (Congratulations!) show showpage -- =====================================================================Herb Lewis Silicon Graphics Networking Engineer 1600 Amphitheatre Pkwy MS-510 Strategic Software Organization Mountain View, CA 94043-1351 herb@sgi.com Tel: 650-933-2177 http://www.sgi.com Fax: 650-932-2177 ======================================================================