Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with script to automate CUPS printer installs Post 302749087 by aperfecthalo on Thursday 27th of December 2012 12:45:11 PM
Old 12-27-2012
Hi RudiC,

Thanks for the speedy response. I'll go through my code and amend the unterminated if/elif statments first - am I correct in thinking I'll simply need to add the second fi in after the last elif? Eg:

Code:
if [ "$option-oki" = "1" ]; then
            read -p "How many paper trays will this printer have? Enter MF/1/2 : " b4350-trays
                if [ "$4350-trays" = "MF" ]; then
                DRV1=$B4350MF
                elif [ "$4350-trays" = "1" ]; then
                DRV1=$B4350MF
                DRV2=$B4350T1
                elif [ "$4350-trays" = "2" ]; then
                DRV1=$B4350MF
                DRV2=$B4350T1
                DRV3=$B4350T2
            fi
    fi

If I'm wrong, apologies. I never thought of using select in all honesty, I (at least thought I) knew the if, so I decided to stick in my comfort zone. If it would make more sense using select, I'll look into that.

What do you mean by an options file? Sorry if I'm a bit slow.

Kind regards.
 

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
XMLIF(1)																  XMLIF(1)

NAME
xmlif - conditional processing instructions for XML SYNOPSIS
xmlif [attrib=value...] DESCRIPTION
xmlif filters XML according to conditionalizing markup. This can be useful for formatting one of several versions of an XML document depending on conditions passed to the command. Attribute/value pairs from the command line are matched against the attributes associated with certain processing instructions in the docu- ment. The instructions are <?if> and its inverse <?if not>, <?elif> and its inverse <?elif not>, <?else>, and <?fi>. Argument/value pairs given on the command line are checked against the value of corresponding attributes in the conditional processing instructions. An `attribute match' happens if an attribute occurs in both the command-line arguments and the tag, and the values match. An `attribute mismatch' happens if an attribute occurs in both the command-line arguments and the tag, but the values do not match. Spans between <?if> or <?elif> and the next conditional processing instruction at the same nesting level are passed through unaltered if there is at least one attribute match and no attribute mismatch; spans between <?if not> and <?elif not> and the next conditional process- ing instruction are passed otherwise. Spans between <?else> and the next conditional-processing tag are passed through only if no previous span at the same level has been passed through. <?if> and <?fi> (and their `not' variants) change the current nesting level; <?else> and <?elif> do not. All these processing instructions will be removed from the output produced. Aside from the conditionalization, all other input is passed through untouched; in particular, entity references are not resolved. Value matching is by string equality, except that "|" in an attribute value is interpreted as an alternation character. Thus, saying foo='red|blue' on the command line enables conditions red and blue. Saying color='black|white' in a tag matches command-line conditions color='black' and color='white'. Here is an example: Always issue this text. <?if condition='html'> Issue this text if 'condition=html' is given on the command line. <?elif condition='pdf|ps'> Issue this text if 'condition=pdf' or 'condition=ps' is given on the command line. <?else> Otherwise issue this text. <?fi> Always issue this text. FUTURE DIRECTIONS
The mark-up used by this tool is not set in stone, and may change in the near future. AUTHOR
Eric S. Raymond. Sep 26 2002 XMLIF(1)
All times are GMT -4. The time now is 07:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy