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

Re: Tip of the day: previous command output



One more question for the gurus:

Now that I've got the list of lines (typically filenames) in $kept
how do I get them into the command line _quoted_.

I tried:
 insert-kept-result () {
   [[ -n "$kept" ]] && LBUFFER+=${(qqq)kept}
 }
 zle -N insert-kept-result
 bindkey '\er' insert-kept-result

But that puts quotes around the whole list of filenames instead of quotes
around every single filename, like so:
 "foo bar baz"  instead of  "foo" "bar" "baz"

Actually, ideally I'd like only filenames with spaces and special chars to
be quoted to avoid cluttering up the command line, but I assume that's even
tougher to do. :-(

Thanks,
 Andy.

-- 
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Mitchell's Law of Committees:
  Any simple problem can be made insoluble if enough meetings are
  held to discuss it.  



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