Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with script to automate CUPS printer installs Post 302749105 by RudiC on Thursday 27th of December 2012 01:13:20 PM
Old 12-27-2012
I don't have a ready-to-use solution at hand, but I could imagine a file called OKIprinters contain the following lines with <TAB> separated columns:
Code:
B4350   MF/1/2  sog_oki_b4350_mf.ppd    sog_oki_b4350_t1.ppd    sog_oki_b4350_t2.ppd
B4600   MF/1/2  sog_oki_b4600_t1.ppd    sog_oki_b4600_t2.ppd
B6200   1/2/3   sog_oki_b6200_t1.ppd    sog_oki_b6200_t2.ppd    sog_oki_b6200_t3.ppd
B6250   1/2/3   sog_oki_b6250_t1.ppd    sog_oki_b6250_t2.ppd    sog_oki_b6250_t3.ppd
B6500   1/2     sog_oki_b6500_t1.ppd    sog_oki_b6500_t2.ppd
B710    1/2/3   sog_oki_b710_t1.ppd     sog_oki_b710_t2.ppd     sog_oki_b710_t3.ppd
C330DN  1       sog_oki_c330dn.ppd
C3400   1       sog_oki_C3400.ppd
C3600   1       sog_oki_c3600.ppd

, then a script containing
Code:
$ OKIS=$(cut -f1 OKIprinters)
$ select Pr in $OKIS; do echo $Pr, $REPLY; done
1) B4350
2) B4600
3) B6200
4) B6250
5) B6500
6) B710
7) C330DN
8) C3400
9) C3600
#? 3
B6200, 3

, and you could go on from there, selecting the trays, and then the drivers. If you got a new printer, add a line to your file(s), and it flies.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sharing printer with windows via cups and samba

I want to use my linux box as a print server for my hp printer. I downloaded the linux driver for the printer and installed it. I also configured CUPS and printed a test page with it. Samba is allowing my windows machine to see and install the printer, but when i try to print to it, nothing... (1 Reply)
Discussion started by: Spetnik
1 Replies

2. Linux

Sharing Printer Linux + XP (cups/samba)

I keep getting a access denied error when I install from the XP wizard my Linux shared printer. CUPS CONFIGURATION FILE <Location /admin> # # You definitely will want to limit access to the administration functions. # The default configuration requires a local connection from a user who #... (2 Replies)
Discussion started by: Alux
2 Replies

3. Shell Programming and Scripting

here document to automate perl script that call script

I am trying to use a here document to automate testing a perl script however when the perl script hits a system(perl subscript.pl) call, input is no longer entered into this subscript. here is my script $ cat test.sh #ksh for testcase do program <<-EOF | tee -a funcscnlog.log y... (3 Replies)
Discussion started by: hogger84
3 Replies

4. Linux

mapping of a printer model with a ppd file in CUPS

Hi all, I am currently working on building a GUI to be interfaced with CUPS 1.3.4 package; In my GUI I have a list of printer manufacturers mapped With various printer models ; and for a particular printer model selected I needed to know how to map that model with an Appropriate ppd file; as I... (0 Replies)
Discussion started by: sc3008
0 Replies

5. UNIX for Advanced & Expert Users

Script that can Automate Printer adding task in HP-UX servers

I want to make a script to automate printer adding task.My inputs are like Printer name : xyz Port number :9001 I should write a script to make the Printer adding task will be automated. Like in manually adding task we are doing through hppi or jetadmin tools. ---------- Post updated at... (2 Replies)
Discussion started by: AnilKPatnaik
2 Replies

6. Red Hat

Need a single printer driver added to CUPS

Just got an HP OfficeJet L7680 printer but there are no drivers for it in RHEL5. I just want to add the single driver without installing hplip 3.9.8. It's going to be connected with USB. Is this possible and if so how? (1 Reply)
Discussion started by: deloev
1 Replies

7. SCO

Replace Line Printer Daemon (LPD) with CUPS

hi Howto replace Line Printer Daemon (LPD) with CUPS on SCO 5.0.6? (3 Replies)
Discussion started by: ccc
3 Replies

8. UNIX for Dummies Questions & Answers

Query for printer driver in CUPS

I have a RHEL 4 (probably not important, but whatever) machine with a few dozen network printers set up in CUPS. I would like to replicate this on a second machine. With lpinfo I'm able to get the queue name and device information (socket://ipaddress or whatnot), but I haven't get figured out... (0 Replies)
Discussion started by: kknigga
0 Replies

9. Red Hat

Samba and Cups :: How to Hide Printer Icons

Hi, I am running Linux box with samba-3.0.33 cups-1.3.7 When I access my home folder through windows and give user credentials, it works well but shows all the printers icons as well. I would like to hide them all from users. I tried changing Browsing On to Browsing Off in... (1 Reply)
Discussion started by: amit_spl
1 Replies

10. Solaris

Printer configuration Migration from Solaris 10 "LP" to Solaris 11 "CUPS"

Need to find a way to import an LP printers.conf file to CUPS. I have some new Solaris 11.1 boxes that need to have 300 printers added. (0 Replies)
Discussion started by: os2mac
0 Replies
ppd_find_choice(3)					     Library Functions Manual						ppd_find_choice(3)

NAME
ppd_find_choice, ppd_find_marked_choice, ppd_find_option_by_keyword - set of functions for returning pointers to choices from PPD files. SYNOPSIS
#include <ppd.h> PpdChoice *ppd_find_choice (PpdOption *o, const char *choice); PpdChoice *ppd_find_marked_choice (PpdFile *ppd, const char *keyword); PpdOption *ppd_find_option_by_keyword (PpdFile *ppd, const char *keyword); DESCRIPTION
These three functions allow the programmer access options and choices within a PPD file. PpdChoice *ppd_find_choice (PpdOption *o, const char *choice); This function accepts two parameters. The first is a pointer to a PPD option structure and the second is the name of the choice to locate. PpdChoice *ppd_find_marked_choice (PpdFile *ppd, const char *keyword); This function accepts a valid PpdFile pointer (see ppd_file_new(3)) and a keyword or option name to locate in the PPD file. PpdOption *ppd_find_option_by_keyword (PpdFile *ppd, const char *keyword); This function accepts two parameters which are identical to those used when invoking the ppd_find_marked_choice() function. However, the ppd_find_option_by_keyword() function does not mark the designated option as being selected. RETURN VALUE
ppd_find_choice() Return a pointer to an option choice; NULL in the case of a failure ppd_find_marked_choice() Return the marked choice for the specified option; NULL in the case of a failure ppd_find_option_by_keyword() Return a pointer to the specified option; NULL in the case of a failure SEE ALSO
ppd_file_new(3), ppd_emit_to_file(3), ppd_file_free(3), ppd_get_num_conflicts(3), ppd_check_option_is_marked(3), ppd_get_page_length(3) AUTHOR
This man page was written by Gerald Carter <gcarter@valinux.com>. It was updated by Mark Fasheh <mfasheh@valinux.com> to reflect changes in libppd 0.5 Some of the code for these functions was originally part of the Common UNIX Printing System (CUPS). ppd_find_choice(3)
All times are GMT -4. The time now is 01:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy