It can be a chore sometimes, setting up printcap files. I have samba and cups setup
on my one OpenBSD box so my windows box will be able to print there. On my other
OpenBSD box, I really don't need anything more than just the command line and my
ssh keys which I have on both OpenBSD boxes. I learned early on how easy it was to
just send the file over ssh to the remote printer:
$ cat file |ssh user@remotebox 'lpr -Prmprinter'Doing it in a script was a little harder for me, but I figured it out:
#!/bin/shJust be sure you have your ssh keys setup on both ends. Here are two links, one on
# script to print file to remote host over ssh
#
if [ -e $1 ]; then
cat $1 | ssh user@somebox "lpr -Pprintername"
else
echo "Input file not found - Aborting!"
fi
Now, from the command line, I type:
$ printremote.sh filename<CR>
No affiliation between this site and the OpenBSD project exists or is implied.