From: "Christopher C. Stevenson" <csteven () kelvin ! physics ! mun ! ca>
To: tru64-unix-managers
Subject: embarassing/frustrating sed question
Date: Wed, 25 Nov 1998 21:12:44 +0000 [thread overview]
Message-ID: <96078728412201.tru64-unix-managers.marc@archive.invalid> (raw)
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
======================================================================
reply other threads:[~1998-11-25 21:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox