SPUG: (No Subject)

Tim Maher tim at consultix-inc.com
Thu Apr 1 13:40:34 CST 2004


On Thu, Apr 01, 2004 at 11:26:47AM -0800, vikas verma wrote:
> Hi, can somebody tell me what's the command/pattern to find leading blank space in a file.
> Thanks
> 

If you mean "find and print lines that have leading whitespace characters":

	perl -wln -e '/^\s/ and print;' filename(s)

*--------------------------------------------------------------------------*
| Tim Maher, CEO     (206) 781-UNIX      (866) DOC-PERL     (866) DOC-UNIX |
| tim(AT)Consultix-Inc.Com  http://TeachMePerl.Com  http://TeachMeUnix.Com |
*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*
|  Classes: Perl Prog. plus Perl Modules, 4/5-4/8 ;  Template Toolkit: TBA |
| Watch for my upcoming book: "Minimal Perl for Shell Users & Programmers" |
*--------------------------------------------------------------------------*



More information about the spug-list mailing list