Sponsored Content
Top Forums Shell Programming and Scripting Remove a line from printers.conf file Post 302508571 by nlsfn on Monday 28th of March 2011 01:06:02 PM
Old 03-28-2011
Remove a line from printers.conf file

I am looking to remove a line from /etc/cups/printers.conf file. In 10.04 when adding a printer through NoMachine a line gets added to the conf file called AuthInfoRequired username,password.

I am looking to make a script that will run as a cron to search for those lines in the conf file and remove them. I am pretty new to scripting and any help will be appreciated. I can do a grep on the file and pull the info, just having troubles on deleting the line.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove every third line from a file

I need to remove every second and every third line from a file. My idea was to do it in two operations. First every third line, then every second line. The problem is that i can't find out how to do it. I tried to look for some sed oneliners, but couldn't find any. Suggestions? (4 Replies)
Discussion started by: bistru
4 Replies

2. Shell Programming and Scripting

Remove header(first line) and trailer(last line) in ANY given file

Hi, I need some help in removing the header (first line) and the trailer (last line) in a give file... The data file actually comes in EBCDIC format and I converted it into ASCII.. Now I need to strip off the first line and the last line.. I think we can use sed to do something like this:... (2 Replies)
Discussion started by: madhunk
2 Replies

3. Windows & DOS: Issues & Discussions

Display Printers via command line

Is there an easy way to view all printers on a local machine via command line or a script? I'm looking for the equivalent of clicking on "START, CONTROL PANEL, PRINTERS AND FAXES" to view the devices. I then want to cat it to a file where I would use it later. Thanks (3 Replies)
Discussion started by: gseyforth
3 Replies

4. UNIX for Dummies Questions & Answers

remove a line within a file

Hi all, i have a text file similar to belowA1 A2 A3 B1 ... .... *** # first occurance B1 ... .... *** # second occurance B1 ... .... *** # third occurance My desired output is B1 ... .... *** # second occurance B1 ... .... *** # third occurance I want to remove the first line that is after... (3 Replies)
Discussion started by: new2ss
3 Replies

5. Shell Programming and Scripting

Remove a line from a file

Hi ,guys. I have one question: I want to write a script which removes a line with certain string from a file, for example The name of the file is: "passwd", the contents of it is below: ************************* ... brownj2:x:5000: hynesp:x:5001: leeb:x:5002 dioxna:x:5003 ... ... (2 Replies)
Discussion started by: daikeyang
2 Replies

6. Solaris

basic question on sd.conf and lpc.conf file

Hello Guys, Do we need to configure this file only if we add SAN disk or even if we add local disk, do we need to modify? (4 Replies)
Discussion started by: mokkan
4 Replies

7. Shell Programming and Scripting

Remove first line of file

Is there an easy way to remove the first line of a file so that the file: aaron benjamin cecilia daniel elliot fernando would become benjamin cecilia daniel elliot fernando (4 Replies)
Discussion started by: locoroco
4 Replies

8. Solaris

Moving /etc/printers.conf

Hi all, I am requested to move printer definitions/configurations to new box (Solaris 10). The old box (Solaris 8) only has /etc/printers.conf configured. There are no /etc/lp/interface or /etc/lp/printer files. What I did was, I just moved /etc/printers.conf file to the new box and... (1 Reply)
Discussion started by: davinccy
1 Replies

9. Shell Programming and Scripting

Remove line from file and read file line by line

I have a file output.txt. File looks like this name1 10 name2 2 name3 5 I get a number n and I need to remove all lines which has number (after name) smaller or equal to n number. After that I need to write lines from file and my output must be like this: Output: 'name1 10' Output: 'name2... (1 Reply)
Discussion started by: kubo12312
1 Replies
printers.conf(5)						    Apple Inc.							  printers.conf(5)

NAME
printers.conf - printer configuration file for cups DESCRIPTION
The printers.conf file defines the local printers that are available. It is normally located in the /etc/cups directory and is generated automatically by the cupsd(8) program when printers are added or deleted. Each line in the file can be a configuration directive, a blank line, or a comment. Comment lines start with the # character. DIRECTIVES
<Printer name> ... </Printer> Defines a specific printer. <DefaultPrinter name> ... </Printer> Defines a default printer. Accepting Yes Accepting No Specifies whether the printer is accepting new jobs. AllowUser [ user @group ... ] Allows specific users and groups to print to the printer. DenyUser [ user @group ... ] Prevents specific users and groups from printing to the printer. DeviceURI uri Specifies the device URI for a printer. ErrorPolicy abort-job ErrorPolicy retry-current-job ErrorPolicy retry-job ErrorPolicy stop-printer Specifies the error policy for the printer. Info text Specifies human-readable text describing the printer. JobSheets banner banner Specifies the banner pages to use for the printer. KLimit number Specifies the job-k-limit value for the printer. Location text Specifies human-readable text describing the location of the printer. OpPolicy name Specifies the operation policy for the printer. PageLimit number Specifies the job-page-limit value for the printer. PortMonitor monitor Specifies the port monitor for a printer. QuotaPeriod seconds Specifies the job-quota-period value for the printer. Shared Yes Shared No Specifies whether the printer is shared. State idle State stopped Specifies the initial state of the printer (Idle or Stopped) StateMessage text Specifies the message associated with the state. StateTime seconds Specifies the date/time associated with the state. SEE ALSO
classes.conf(5), cupsd(8), cupsd.conf(5), mime.convs(5), mime.types(5), http://localhost:631/help COPYRIGHT
Copyright 2007-2011 by Apple Inc. 29 April 2009 CUPS printers.conf(5)
All times are GMT -4. The time now is 02:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy