All of lore.kernel.org
 help / color / mirror / Atom feed
* smbprint
@ 2003-02-14 14:00 Kurt Sys
  2003-02-15  1:15 ` smbprint whitnl73
  0 siblings, 1 reply; 3+ messages in thread
From: Kurt Sys @ 2003-02-14 14:00 UTC (permalink / raw)
  To: Linux Newbie

Hello,

I try to get samba to work, especially the printing to a windows NT network printer. I can print to the printer by using smbprint etc, but this always takes some time (first 'gs -sDEVICE=ljet -sOutputFile=file.hp file.pdf' followed by 'smbclient \\\\labmetserver\\HPLaserJ -Ukurts%xxxxx' and finally giving the command 'print file.hp'). So, I decided to try to make an entry in my printcap-file (I show it here, although I'm sure that this doesn't matter for the problem I have...):

----
smb0|SMB.HP.LJ4.normal.1:\
        :cm=HP LaserJet 4 computerlokaal:
        :lp=/dev/smb0:\
        :sd=/var/spool/lpd/smb0:\
        :af=/var/spool/lpd/smb0/acct:\
        :mx#0:\
        :if=/usr/local/bin/smbprint
----

And then I had to make two more files (these are the important ones, I guess): 
/var/spool/lpd/smb0/.config:
----
server = LABMETSERVER
service = HPLaserJ
user = kurts
password = "xxxxxx"
----

and the file /usr/local/bin/smbprint:
----
#!/bin/sh -x

logfile=/tmp/smb-print.log

eval acct_file=\$$#

spool_dir=/var/spool/lpd/smb0
config_file=$spool_dir/.config

eval cat $config_file

echo "server $server, service $service" >> $logfile

(
echo translate
echo "print -"
cat
) | /usr/bin/smbclient "\\\\$server\\$service" -U$user>> $logfile
----


I didn't add my password here, but it should prompt for it anyway. Now, I just try the smbprint-script first, but it won't work:

----
$ smbprint "test"
+ logfile=/tmp/smb-print.log
+ eval 'acct_file=$1'
++ acct_file=test
+ spool_dir=/var/spool/lpd/smb0
+ config_file=/var/spool/lpd/smb0/.config
+ eval cat /var/spool/lpd/smb0/.config
++ cat /var/spool/lpd/smb0/.config
server = LABMETSERVER
service = HPLaserJ
user = kurts
password = "xxxxx"
+ echo 'server , service '
+ echo translate
+ echo 'print -'
+ cat
+ /usr/bin/smbclient '\\\' -U
\\\: option requires an argument -- U

----

Apparently, the variables 'server', 'service', 'user' and 'password' are not read (since they are replaced by nothing). What am I doing wrong?



thanks in advance,
Kurt
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-17 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-14 14:00 smbprint Kurt Sys
2003-02-15  1:15 ` smbprint whitnl73
2003-02-17 11:25   ` smbprint Kurt Sys

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.