Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printcap modifcation

Status
Not open for further replies.

vti

Technical User
Feb 26, 2001
189
TR
Hi,
I want add a line into printcap file under the line which starts like " :rm=domain1:\ "

So it is gonna be like

:rm=test249:\ (This line is different for all entry)
:mj=5000:\ (this line is gonna be same for all entry)

How can i do this by sed or something else.
Thanks for any help.
 
put in sedcmd
------------------
/^rm=/asosososo

------------------
nota the empty line at end of sedcmd
sed -f sedcmd filein >fileout
or in vi

:%s/^rm=.*/&^Msososososo^M/

^M is cntrolVcontrolM -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
hi jamisar,
Thanks for help but it didn't work.
I want to put :mj=5000:\ line to under of all lines which start with :rm=

.
 
yes i fergot the ending
in vi (tested):

:%s/^rm=.*/&^V^M:mj=5000:\\/ -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
hi
Sorry but doesn't work ,i ll send you part of printcap

test1|lp17: :lf=/usr/adm/lp17err: :lp=: :rm=test111: :rp=port_1: :sd=/usr/spool/lpd17:

I want to change it as;

test1|lp17: :lf=/usr/adm/lp17err: :lp=: :rm=test111: :mj=5000: :rp=port_1: :sd=/usr/spool/lpd17:


 
yuo said a line starting by :rm.....
don't you see the TAB before it ?
insert a TAB-char
:%s/^TAB:rm=.*/&^V^MTAB:mj=5000:\\/ -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top