This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ILUG] bash script Q


According to Justin MacCarthy:
> Hi,
> 	anyone point me to the best bash script option for checking the first 2
> characters of all the files in a directory?
> 
> logic of the script is
> 
> for each file in directory
> 	test if the first 2 chars are "%!"
> 		print Filename	valid
> 	if not
> 		print Filename	not valid
> 
> 
> Does magic do something like this ?
> 
> 
> Thanks Justin

Well, I guess file * would tell you they're postscript if they start with "%!"

Or you could use a perl one-liner.

Waider.
-- 
waider@dspsrv.com / Chances are I'm not at home right now.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]