Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: array with newlines preserved as literal text



On 2021-02-03 1:19 p.m., Bart Schaefer wrote:
On Wed, Feb 3, 2021 at 11:29 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
Nuts what am I doing wrong trying to save to a variable:

_fn2hist() {
  emulate -L zsh
  local cmd=$1
  shift
  if [[ -n $functions[$cmd] ]]
  then
    print -rS "${$(functions -x 2 $cmd)#$cmd} ${${(qq)@}}"
    print -rv _com "${$(functions -x 2 $cmd)#$cmd} ${${(qq)@}}"
  fi
  $cmd "$@"
  print -rl "_com is: $_com"  # Nothing in the variable.
}





Messages sorted by: Reverse Date, Date, Thread, Author