smbprint script problem
I'm trying to print to a printer hanging off a WinNT box using smbprint.
Here's the relevant code of /etc/samba/smbprint:
======================================
#
# Some debugging help, change the >> to > if you want to save space.
#
echo "SERVER = $server" >> $logfile
echo "SERVICE = $service" >> $logfile
echo "Spool Directory = $spool_dir" >> $logfile
echo "Config File = $config_file" >> $logfile
echo "Accounting File = $acct_file" >> $logfile
#echo "PASSWORD = $password" >> $logfile
(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
if [ $TRANS -eq 1 ]; then
echo translate
fi
echo "print -"
cat
) | smbclient //$server/$service -U $password >> $logfile
echo "---------------------" >> $logfile
==================================
And here's the log file when I do a "lp /etc/samba/smbprint":
SERVER = helpdesk3
SERVICE = zel319hp
Spool Directory = /var/spool/lpd/hplj3-remote
Config File = /var/spool/lpd/hplj3-remote/.config
Accounting File = /var/spool/lpd/hplj3-remote/acct
added interface ip=xxx.yyy.zzz.qqq bcast=xxx.yyy.poo.poo nmask=255.255.248.0
Got a positive name query response from xxx.yyy.zzz.lmn ( xxx.yyy.zzz.trs )
Domain=[ACU] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> rd >> $logfile: command not found
smb: \> smb: \> (: command not found
smb: \> #(: command not found
smb: \> #: command not found
smb: \> #: command not found
smb: \> if: command not found
smb: \> echo: command not found
smb: \> fi: command not found
smb: \> echo: command not found
smb: \> cat: command not found
smb: \> ): command not found
smb: \> smb: \> echo: command not found
smb: \> smb: \>
Not being very familiar with scripting, I can only guess that the
portion between the ( and ) marks should be getting piped to smbclient,
yet from the log file it looks like everything from the "rd" in password
a line or two above the opening ( mark is getting piped.
Any ideas?
Thanks!
Kent
Reply to: