Quoth Skip Tavakkolian <[email protected]>:
> I don't believe there is a good way of preserving quotes (') in $*. I
> ran into this while trying to:
> 
> % window winwatch -e '^(winwatch|stats|faces)'  # will not work
> % window winwatch -e '''^(winwatch|stats|faces)'''  # works
> 
> I think this comes down to how quotes are handled in $*:
> 
> % tail -1 /rc/bin/window    # the relevant line
> if not echo new -cd `{pwd} $* >> `{getwctl}
> 
> having to stack quotes manually makes interactions like cut-paste
> awkward/unusable.

hi skip; yeah, this is a bit unfortunate/ugly..  we have to use whatis
to wrap it in quotes in case it contains rc syntax, and then trim off
the cmd= bit, the following would be for 9front's /rc/bin/window, but
isn't too dissimilar from your sources, except that for *, we can't
let it expand:

        {whatis '*' | ...}

diff 0a95f5b69eb5f4b57b50b0e8389f05138dc32427 uncommitted
--- a/rc/bin/window
+++ b/rc/bin/window
@@ -106,5 +106,5 @@
 
        if(! ~ $#wdir 0)
                spec=($spec -cd `{a=$wdir whatis a|sed 's!^a=!!;q'})
-       echo new $spec $argv0 -x $cmd >>$wctl
+       echo new $spec $argv0 -x `{whatis cmd | ssam -n '#4,'} >>$wctl
 }

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Te16808448e498abd-M13dfcbd9ca70bfeb6874d869
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to