Script troubles.
Chris Janicki
Janicki at ia-inc.com
Thu Apr 5 20:55:35 EDT 2001
How about some negative matching, like:
s/[^\t-~]//g
Replace anything that's not between a tab (ASCII #9) and a tilde (ASCII
#126). Disclaimer: I don't know sed... maybe you have to escape the
brackets?
There's probably also some nomenclature for specifying an ASCII character
code, but I couldn't find it in my references. Maybe consult the man
page for advanced regular expressions?
--
Chris Janicki
781-662-9424
Industrious Activities, Inc.
http://www.ia-inc.com
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 4/5/01, 8:15:48 PM, John Whitfield <john_whitfield at email.com> wrote
regarding Script troubles.:
> Hullo,
> I'm having trouble with a UNIX script (K-shell in HP-UX) and was hoping
> someone could help. I've got a file I'm trying to send that has bad
> characters in it (ASCII 142). I could write a C program, but I'm trying
to
> avoid that. Is there a way I could get a shell command to do something
like
> this:
> cat infile.dat | sed "s/<<junk>>/<<blank>>/g" > outfile.dat
> The stream editor is easy enough, but I can't seem to get it to recognize
> the bad character. Any ideas?
> AdvThanxance,
> John Whitfield
> -----------------------------------------------
> FREE! The World's Best Email Address @email.com
> Reserve your name now at http://www.email.com
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).
More information about the Discuss
mailing list