diffing special chars

der.hans PLUGd@LuftHans.com
Thu, 24 Aug 2000 16:39:40 -0700 (MST)


Am 24. Aug, 2000 schwäzte Kevin Buettner so:

> On Aug 23, 11:12pm, der.hans wrote:
> 
> > Anyone know a solution that doesn't require brute forcing with tools like
> > perl or sed/awk?
> 
> Why don't you want to use perl?  It's a perfectly acceptable tool for
> this job.  Below is a little script which'll list out verbatim the

I'm trying to do something simple in shell, that is functional and can be
understood by newbies. The whole thing could be done quite well with perl,
but the goal is to make it a shell script.

perl -e '$_=shift;s@\\ @ @g; print "$_\n";' "fred\ wuz\ hier on\ Thu."

That really isn't too bad, but I'd like something simpler. OTOH, I'm
needing to parse my output with perl later because shell just can't do it,
so I might fix the probs there.

> names of the files regardless of the embedded control characters,
> spaces, etc.  Use it to create your file lists and then use diff on
> them as before.

Maybe I should just admit that shell sucks and move completely to perl
;-). Shell's nice for simple stuff, though. Also, I think it's a great way
to get people used to using the command line. Just as command line
editting is great way to get them to learn vi or emacs :).

This works well. David's one liner is probably better because I'm
manipulating 60+MB files and I don't really want the whole thing in one
var :).

I will certainly be doing something like this if I do the whole thing in
perl as well.

danke,

der.hans

PS perl modules rock!

-- 
#  der.hans@LuftHans.com   home.pages.de/~lufthans/   www.Opnix.com
#  I've got a photographic memory,
#  but I'm lousy photographer. - der.hans