* 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* Re: smbprint
2003-02-14 14:00 smbprint Kurt Sys
@ 2003-02-15 1:15 ` whitnl73
2003-02-17 11:25 ` smbprint Kurt Sys
0 siblings, 1 reply; 3+ messages in thread
From: whitnl73 @ 2003-02-15 1:15 UTC (permalink / raw)
To: kurt.sys; +Cc: linux-newbie
On Fri, 14 Feb 2003, Kurt Sys wrote:
> 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...):
...
>
> 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
Excuse me? Why do you think this will set any shell variables?
This is just going to copy your config file to stdout.
See "help eval" and man cat.
I think you want something like
tn=`mktemp /tmp/x.XXXXXXX` && sed 's/ //g' $cf >$tn && source $tn && rm $tn
unset tn
AFAIK, the way to set a shell variable is: "name=value",
not "name = value", hence the sed
>
> Apparently, the variables 'server', 'service', 'user' and 'password' are not read (since they are replaced by nothing). What am I doing wrong?
>
why would cat be setting variables?
>
> thanks in advance,
> Kurt
> -
>
Lawson
--
---oops---
________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com
-
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
* Re: smbprint
2003-02-15 1:15 ` smbprint whitnl73
@ 2003-02-17 11:25 ` Kurt Sys
0 siblings, 0 replies; 3+ messages in thread
From: Kurt Sys @ 2003-02-17 11:25 UTC (permalink / raw)
To: linux-newbie
Hello,
tnx, it seems to work now, at least, the variables are set.
Well, what I thought was: if you do 'cat $config_file', the config-file is 'shown', so I thought that the command 'eval cat $config_file' would result in:
eval server=LABMETSERVER service=HPLaserJ user=kurts passwd=XXXXX
and this would set the variables, no? I still don't understand why this is not ok...
Anyway, the spaces, that was clearly an error. I removed these...
tnx,
Kurt.
Mail from whitnl73@juno.com, sent on Friday February 14 2003 at 20:15 (GMT-0500):
> On Fri, 14 Feb 2003, Kurt Sys wrote:
>
> >
> > spool_dir=/var/spool/lpd/smb0
> > config_file=$spool_dir/.config
> >
> > eval cat $config_file
>
> Excuse me? Why do you think this will set any shell variables?
> This is just going to copy your config file to stdout.
> See "help eval" and man cat.
>
> I think you want something like
>
> tn=`mktemp /tmp/x.XXXXXXX` && sed 's/ //g' $cf >$tn && source $tn && rm $tn
> unset tn
>
> AFAIK, the way to set a shell variable is: "name=value",
> not "name = value", hence the sed
-
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.