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/