From: Ryan Chan on
Hi,

What are the recommended tool for string replacement in a file without
using sed? Since I don't want to take care about regex/escape issues -
since all my search/replace are just basic substitution.




From: Chris F.A. Johnson on
On 2010-06-18, Ryan Chan wrote:
> Hi,
>
> What are the recommended tool for string replacement in a file without
> using sed? Since I don't want to take care about regex/escape issues -
> since all my search/replace are just basic substitution.

Why don't you want to use sed? That's the natural tool to use.

You could use awk, but it's more works than using sed.

--
Chris F.A. Johnson, <http://cfajohnson.com>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
From: Stuart Gall on
On 2010-06-18 21:00:21 +0300, Ryan Chan <ryanchan404(a)gmail.com> said:

> Hi,
>
> What are the recommended tool for string replacement in a file without
> using sed? Since I don't want to take care about regex/escape issues -
> since all my search/replace are just basic substitution.


vi ?

--
TIA
Stuart
--
There are three kinds of mathematician
Those that can count and those that cant.

From: despen on
Ryan Chan <ryanchan404(a)gmail.com> writes:

> Hi,
>
> What are the recommended tool for string replacement in a file without
> using sed? Since I don't want to take care about regex/escape issues -
> since all my search/replace are just basic substitution.

What are "regex/escape issues"?

If you don't want sed to use a regex, don't type one in.

If you want to search/replace characters like "[", ".", "*", etc.
I'm sure someone will supply a script.

From: Todd on
On 06/18/2010 11:00 AM, Ryan Chan wrote:
> Hi,
>
> What are the recommended tool for string replacement in a file without
> using sed? Since I don't want to take care about regex/escape issues -
> since all my search/replace are just basic substitution.

Hi Ryan,

I have no clue. Sorry.

If you ever give up and want to go back to "sed", here is
a link with a zillion one line examples. The remove
duplicate lines does not work.

http://sed.sourceforge.net/sed1line.txt

-T
"sed" is nasty. I do not blame you looking for an alternative