[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval a=b\ c
From: |
Eduardo A . Bustamante López |
Subject: |
Re: eval a=b\ c |
Date: |
Wed, 27 May 2015 23:55:47 -0500 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, May 27, 2015 at 12:59:53AM -0700, Dave Yost wrote:
> OK, I can make it to work in bash if I say
> echodo a=b\\ c
> but then zsh tries to execute c. Can’t win.
>
> The problem is: how do I write this function so that it can be invoked
> identically in zsh and bash with identical results of setting a variable to a
> value with a space in it?
dualbus@hp ~ % for sh in bash zsh; do "$sh" -c 'echodo(){ echo "$*"; eval "$@";
}; echodo a=b\\ c; echo "$a"'; done
a=b\ c
b c
a=b\ c
b c
--
Eduardo Bustamante
https://dualbus.me/
- eval a=b\ c, dave, 2015/05/25
- Re: eval a=b\ c, Charles Daffern, 2015/05/25
- Re: eval a=b\ c, Linda Walsh, 2015/05/25
- Re: eval a=b\ c, Dennis Williamson, 2015/05/25
- Re: eval a=b\ c, Andreas Schwab, 2015/05/26
- Re: eval a=b\ c, Dave Yost, 2015/05/27
- Re: eval a=b\ c,
Eduardo A . Bustamante López <=
- Re: eval a=b\ c, Greg Wooledge, 2015/05/26