Hi Sebastian, I'm not sure what you want to do, but I my guts tells me that you want to re-invent the wheel as you stated that you want to replace several tools with ZSH. If you can achieve your goal by calling a GNU tool, you should do that. These are mature tools and there is nothing wrong about using them. (And it's certainly a benefit that you don't have to maintain them.) Calling "grep" is also more understandable by everyone than the pattern you gave in your first email. Best regards Christian > The idea is to confront Bash Advanced Scripting Guide coders, BASG > coders for short. Every sed, awk, grep can be replaced by Zsh code. > No > need for `` / $() what Bash coders love (not all, could name at least > one that doesn't, is present at #zsh IRC channel). However, grep -C > is > not very possible to replace with Zsh code. I plan to write > Markdown/PDF  document where every GNU utility will be coded via > native Zsh code, without forks, and the grep -C is one problem that I > can perceive now. > > Best regards, > Sebastian Gniazdowski