Posted in Command Line, Perl Command to Print Until Regular Expression Binny V A October 1, 2007 Leave a Comment on Command to Print Until Regular Expression Print a file until a regular expression is matched. cat file.txt | perl -pe "exit if(/Thats all/)" Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.