On 8/8/05, Ken Moffat <[EMAIL PROTECTED]> wrote:
> +    p=${i//\\\\/\\\\}
> +    p=${p//|/\\|}
> +    p=${p//&/\\&}
> +    bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${p}:|"
> 
>  Now, think I can understand the second and third assignments to p
> (replace all instances of | and & with doubly-escaped versions, the
> 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
--
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to