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

unmatched '



I have a function that lists all directories matching a nesting set of strings:

$ c etc systemd system

... the list is culled by matching each string in turn.  It works fine except that:

$ c etc

(eval):1: unmatched '

... but that's the one and only directory that throws that error.  I've tested dozens of directories and combinations and all are fine except 'etc'. I suspect this abomination:

/etc/DSHR's Blog: Using the official Linux overlayfs_files

... God knows why that's permitted, but I'm thinking that the single quote is doing the obvious thing as far as 'eval' in concerned.  Can I prevent that?  Or, if it must be an error, can I get eval to ignore it somehow? The offending line is this:

baz=(`eval print -l $bar $grepstring`)

... I want to sent the output of printing '$bar' after it's been piped through the chain of greps that are built up and saved in the '$grepstring' variable, and save that filtered and colored result in '$baz'.  Apart from the above, it works perfectly.  I'm betting there's a flag ${(flag)bar} that fixes it, i.e. forcing " DSHR's " to be literal.  Otherwise I will excoriate the offending directories.  Work of the Devil.




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