% arara: pdflatex: { shell: yes }
\documentclass{article}
\usepackage{fancyvrb}
\makeatletter
\newcommand{\callcowsay}{\VerbatimInput{\@@input|"cat tmp.cow | cowsay"}}
\makeatother
\newenvironment{cowsay}
{\VerbatimOut{tmp.cow}}
{\endVerbatimOut\callcowsay}
\begin{document}
\begin{cowsay}
Hello world, how are you?
\end{cowsay}
\end{document}