* embarassing/frustrating sed question
@ 1998-11-25 21:12 Christopher C. Stevenson
0 siblings, 0 replies; only message in thread
From: Christopher C. Stevenson @ 1998-11-25 21:12 UTC (permalink / raw)
To: tru64-unix-managers
Greetings,
Sed is not completely unknown to me, but today I tried using it
to substitute newlines for ^M's in a Postscript printjob originating
from a Mac (which has no linefeeds, causing things like 'awk' and 'vi' to
choke on too-long lines if you try to manipulate them), and am having
trouble getting sed to spit out literal \n's. This is under DU 4.0B.
I first tried
sed 's/^M/\n/g' mac.ps
which substituted simple "n's". (Note that CTRL-V-CTRL-M is how you
specify the literal ^M. Saddly, on this keyboard, I can't specify a
literal LF). Then I tried a few more;
sed 's/^M/"\010"/g' mac.ps -substitutes "010" for ^M's
sed 's/^M/"\n"/g' mac.ps -"n" again
sed s/^M/\\n/g mac.ps -and again...
(etc)
None of these work, I've run out of delimiters to try, any number of
backslashes seem to be ignored, I can't seem to tell sed what character to
print as I can (trivially) awk or echo by specifying "\123" whatever...
there must be something I've missed.
Any ideas at all? This is perhaps even more annoying because it
should take only a moment to do, but now has me pulling my hair
out. I'll summarize.
Cheers
Chris
======================================================================
Christopher C Stevenson C3004 office: (709) 737-2624
Dept. of Physics & Physical Oceanography fax: (709) 737-8739
Memorial University of Newfoundland
St. John's, Newfoundland, CANADA A1B 3X7
URL: http://www.physics.mun.ca/~csteven
======================================================================
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-11-25 21:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-11-25 21:12 embarassing/frustrating sed question Christopher C. Stevenson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox