ppd
format that contains configurations of a printer installed in my sector, I need to change one line from one file to another with the command sed
, the problem is greater and that this line that I try to change inside the file has special characters of a command, so I have to replace the whole line with another one inside the file, here is the expression I tried:
Excerpt from file where a line needs to be changed:
*DefaultLockedPrintPassword: None
*LockedPrintPassword None/None: ""
*LockedPrintPassword 4001/4001: "%% FoomaticRIPOptionSetting:
LockedPrintPassword=4001"
*FoomaticRIPOptionSetting LockedPrintPassword=4001: "mark\n&&
(&user;) (20'date +%y%m%d%R | sed 's/://'') (4001) {secureprint} stopped\n&&
cleartomark\n"
*End
I need to change this line:
(&user;) (20'date +%y%m%d%R | sed 's/://'') (4001) {secureprint} stopped\n&&
For this:
(&userid;) (20'date +%y%m%d%R | sed 's/://'') (9999) {secureprint} started\n&&
I would have to do this on several computers, the worst that I add the sed command to change this line it confuses because it treats the line that I want to change with another command because it is a command that the printer file executes, that file and a Linux printer configuration file.