On Mon, 8 Aug 2005, Mike Hernandez wrote:
> On 8/8/05, Ken Moffat <[EMAIL PROTECTED]> wrote:
> > double-escape being necessary for sed), but the first one
> >
> > p=${i//\\\\/\\\\}
> >
> > baffles me. $i will be the filename, I assume, so the patch changes
> > every instance of '\\\\' to the exact same '\\\\' ?
>
> What I see in all three is that /something is being replaced with
> \something. In the second case it looks like /| is being replaced with
> \|, in the third /& is being replaced with \&. The first substitution
> is for a slash, i.e. /\\\\ is being replaced with \\\\
>
> But then again, I'm really just guessing and my coffee cup is still
> half full ;) If I'm way off base then please excuse the noise
>
> Mike
>
Thanks for the suggestion, Mike. This is bash's
${PARAMETER//PATTERN/STRING} operation, so I'm reading that
parameter $i has pattern \\\\ replaced by string \\\\ - that is, the
'//' separates the parameter from the pattern, and the third '/'
separates the pattern from the string ?
And this is all within grep's output, replacing "|^|${p}:|" that is,
replacing the null string at the start of lines with a sanitised
filename followed by a colon, so it only does anything when run against
a series of bzip2'd files.
Ken
--
das eine Mal als Tragödie, das andere Mal als Farce
--
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page