How to strip A NEWLINE
Brian J. Smith
bjs at reef.cis.ufl.edu
Fri Nov 30 16:28:59 AEST 1990
When TFM fails, when all the books I have fail, I run to netland.
I have searched high and low for the answer on how to strip a NEWLINE
charactor from a file. Well not really a NEWLINE char, but a ":\\\n"
(colon,back-slash,newline). I have tried useing sed with:
sed 's/:\\\n//' file
and using the RS variable in awk, but to no avail. sed will remove
the colon and the back-slash, but not the newline.
Here is the section of code that I am playing with.
#
ps301d|bigps|qms|QMS-2210 in E301D:\
:lp=/dev/ttyb:sd=/var/spool/ps301d:\
:af=/var/adm/ps301d.acct:lf=/var/spool/ps301d/errs:\
:br#9600:rw:fc#0000374:fs#0000003:xc#0:xs#0040040:\
:mx#0:rg=printer:sf:sh:\
:if=/local/lib/ps/psif:of=/local/lib/ps/psof:\
:cf=/cis/reef/wp42/bin/wplpr:df=/local/lib/ps/psdf:\
:gf=/local/lib/ps/psgf:nf=/local/lib/ps/psnf:\
:rf=/local/lib/ps/psrf:tf=/local/lib/ps/pstf:\
:vf=/local/lib/ps/psvf:
#
This is what I want the file to look like after the (colon,back-slash,newline)
has been striped. As you can see what I really want is to strip a
(colon,back-slash,newline,tab), but if someone could just get rid of that
darn newline for me I would be *very* happy.
#
ps301d|bigps|qms|QMS-2210 in E301D:lp=/dev/ttyb:sd=/var/spool/ps301d:af=/var/adm/ps301d.acct:lf=/var/spool/ps301d/errs:br#9600:rw:fc#0000374:fs#0000003:xc#0:xs#0040040:mx#0:rg=printer:sf:sh:if=/local/lib/ps/psif:of=/local/lib/ps/psof:cf=/cis/reef/wp42/bin/wplpr:df=/local/lib/ps/psdf:gf=/local/lib/ps/psgf:nf=/local/lib/ps/psnf:rf=/local/lib/ps/psrf:tf=/local/lib/ps/pstf:vf=/local/lib/ps/psvf:
#
I know that perl can most likely solve this probelm nicely, so I am willing to
hear of any responses, but for standardaztion I would like to use only standard
unix filters. Sorry Larry.
--
Brian J. Smith Work: 904-392-1183
CIS Sys Admin Staff 301 CSE Building
bjs at cis.ufl.edu Univ of Florida, 32612
More information about the Comp.unix.shell
mailing list