Re: Variable substitution in sed with pathname

From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 01/14/05


Date: Fri, 14 Jan 2005 11:46:50 -0600


red_valsen@yahoo.com wrote:

> How do I do a simple variable substitution in sed with a value that is
> a pathname ie includes slashes?

Use a different delimiter character, e.g. ":" instead of "/":

echo "$HOME/bin" | sed 's:$HOME:$PWD:'

Regards,

        Ed.