Sponsored Content
Top Forums Shell Programming and Scripting Get a printer name into variable with similar printers Post 303030818 by tomislav91 on Saturday 16th of February 2019 12:16:28 PM
Old 02-16-2019
I solve it like this

Code:
if grep -q S310II /etc/cups/printers.conf; then
 PRINTER="$(grep -B 5 CT-S310II /etc/cups/printers.conf | head -1 | cut -d "<" -f2 | cut -d ">" -f1 | awk -F " " '{print $2}')"

its a workaround but did the trick Smilie


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 02-16-2019 at 02:48 PM.. Reason: Changed QUOTE to CODE tags.
This User Gave Thanks to tomislav91 For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Printers

I'm in need of finding out on how to mount and dismount printers. Thx, shawnnee (1 Reply)
Discussion started by: shawnnee
1 Replies

2. Linux

know I do for to printer in printer deskjet 80colun

I want to print some thing in HP Deskjet 692.? (1 Reply)
Discussion started by: edvaldo
1 Replies

3. Solaris

Configuring Printer with Printer Manager

Hi All, I am trying to configure printer in solaris 10 with the help of print manager. There is no printer attached to my system, ia m doing it for test purpose. However I am unable to do so coz its pops up window - Heading as error with option as dismiss and cancel. Kindly help as I am... (3 Replies)
Discussion started by: kumarmani
3 Replies

4. AIX

Check printer queue on Windows printer server

Hello Let me first give a small overview of the setup. All printers are connected to Windows 2000 servers. There are a lot of UNIX (AIX & HP-UX) servers as well which have SAP running. I'm working on a script to add printers to a specified SAP instance. I want to verify the user input (to... (0 Replies)
Discussion started by: NielsV
0 Replies

5. Shell Programming and Scripting

Using sed (or similar) to rename variable headings

Hello, I'm rather new to the world of regular expressions and sed, though am excited by its possibilities. I have a particular task I'd like to achieve, and have googled the topic quite a bit. However, having found some codes that perform a task very similar to what I'd like to do, I can't for... (2 Replies)
Discussion started by: redseventyseven
2 Replies

6. Linux

Find printer location and printer type

Hi, Is it possible to find the printer location and printer type (whether it is local or network) using command in Linux ? Thanks in advance. (1 Reply)
Discussion started by: forumguest
1 Replies

7. Shell Programming and Scripting

Perl match multiple numbers from a variable similar to egrep

I want to match the number exactly from the variable which has multiple numbers seperated by pipe symbol similar to search in egrep.below is the code which i tried #!/usr/bin/perl my $searchnum = $ARGV; my $num = "148|1|0|256"; print $num; if ($searchnum =~ /$num/) { print "found"; }... (2 Replies)
Discussion started by: kar_333
2 Replies

8. Shell Programming and Scripting

To find ls of similar pattern files in a directory by passing the variable.

Hi, I have file in my $datadir as below :- SAT_1.txt SAT_2.txt BAT_UD.lst BAT_DD1.lst DUTT_1.txt DUTT_la.txt Expected result :- should get all the above file in $<Filename>_file.lst Below is my code :- for i in SAT BAT DUTT do touch a.lst cd $datadir (1 Reply)
Discussion started by: satishmallidi
1 Replies
cupsd(8)							    Apple Inc.								  cupsd(8)

NAME
cupsd - cups scheduler SYNOPSIS
cupsd [ -c cupsd.conf ] [ -f ] [ -F ] [ -h ] [ -l ] [ -s cups-files.conf ] [ -t ] DESCRIPTION
cupsd is the scheduler for CUPS. It implements a printing system based upon the Internet Printing Protocol, version 2.1, and supports most of the requirements for IPP Everywhere. If no options are specified on the command-line then the default configuration file /etc/cups/cupsd.conf will be used. OPTIONS
-c cupsd.conf Uses the named cupsd.conf configuration file. -f Run cupsd in the foreground; the default is to run in the background as a "daemon". -F Run cupsd in the foreground but detach the process from the controlling terminal and current directory. This is useful for running cupsd from init(8). -h Shows the program usage. -l This option is passed to cupsd when it is run from launchd(8) or systemd(8). -s cups-files.conf Uses the named cups-files.conf configuration file. -t Test the configuration file for syntax errors. FILES
/etc/cups/classes.conf /etc/cups/cups-files.conf /etc/cups/cupsd.conf /usr/share/cups/mime/mime.convs /usr/share/cups/mime/mime.types /etc/cups/printers.conf /etc/cups/subscriptions.conf CONFORMING TO
cupsd implements all of the required IPP/2.1 attributes and operations. It also implements several CUPS-specific administrative operations. EXAMPLES
Run cupsd in the background with the default configuration file: cupsd Test a configuration file called test.conf: cupsd -t -c test.conf Run cupsd in the foreground with a test configuration file called test.conf: cupsd -f -c test.conf SEE ALSO
backend(7), classes.conf(5), cups(1), cups-files.conf(5), cups-lpd(8), cupsd.conf(5), cupsd-helper(8), cupsd-logs(8), filter(7), launchd(8), mime.convs(5), mime.types(5), printers.conf(5), systemd(8), CUPS Online Help (http://localhost:631/help) COPYRIGHT
Copyright (C) 2007-2017 by Apple Inc. 12 February 2016 CUPS cupsd(8)
All times are GMT -4. The time now is 10:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy