Re: My script to replace strings in ASCII files
- From: Parv <parv@xxxxxxxx>
- Date: Wed, 11 Jan 2006 18:13:43 -0500
in message <200601112047.k0BKlObZ019514@xxxxxxxxxxxxxxxxx>,
wrote Jerry McAllister thusly...
>
> > Just curious, what do I need to do to be able to execute this
> > script like:
> >
> > $ text-replace old_string new_string
>
> Check out tr(1).
> It does a good job of it with very simple rules.
...
> > sed -i '' "s/old/new/g" "$file"
tr(1) takes a *set of characters* in a string, not the given string
as it is, to "translate characters" ..
echo 'polka dot' | tr 'pol' 'x'
... in the OP's context, above should produce "xka dot" but produces
instead "xxxka dxt".
- Parv
--
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
- References:
- My script to replace strings in ASCII files
- From: Kristian Vaaf
- Re: My script to replace strings in ASCII files
- From: Jerry McAllister
- My script to replace strings in ASCII files
- Prev by Date: Re: replacement for Acrobat Professional?
- Next by Date: Re: replacement for Acrobat Professional?
- Previous by thread: Re: My script to replace strings in ASCII files
- Next by thread: Re: My script to replace strings in ASCII files
- Index(es):
Relevant Pages
|