On Thu, Jan 25, 2001 at 10:21:39AM -0800, Brad Doster wrote:
> 1) I have a variable with a list of variable names as its content, e.g.
> 'varlist=$var1 $var2 $var3'. I want to manipulate $varlist such that it
> ='var1 var2 var3', i.e get rid of the '$'s in front of each variable name.
> A 'sed' example that I've tried is:
>
> varlist=`echo "$varlist" | sed 's/$//'`
Nope. It's
varlist=`echo "$varlist" | sed -e "s/\\\\$//g"
> 2) Given two variables, say var1="a" and var2="b", I want to create var3
> such that it is "a<newline>b", i.e 'echo "$var3"' produces:
>
> a
> b
var3="$var1\\n$var2"
--
Dave "Do I get a prize?" Ihnat
[EMAIL PROTECTED]
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list