Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Use of sed
Date: Wed, 24 Jun 2009 11:28:12
In Reply to: [gentoo-user] [OT] Use of sed by Peter Humphrey
1 Peter Humphrey writes:
3 > I'm reduced to asking a newcomer's question: how can I make sed recurse
4 > down a directory tree?
6 find . -type f -exec sed -i 's/foo/bar/g' '{}' \;
8 > And while I'm at it, how do I change the field
9 > separator from / to enable me to search on that character?
11 Well, just change it :) It does not need to be a /, it is always the first
12 character after the s. sed 's%foo%bar%g' will work just the same.
14 I used to use the § character because it is probably not being used in any
15 of my file names, but maybe it was too special, because kate dropped it
16 silently from my shell scripts I edited, and hell broke loose.
18 > I used to have a "SED and AWK" book, but it seems to have walked; and I
19 > can't see anything helpful from a Google search.
21 man sed answers your second question :)
23 Wonko


Subject Author
Re: [gentoo-user] [OT] Use of sed Peter Humphrey <peter@××××××××××××××.org>