[WNYLUG-Users] more fun

Eric Benoit eric at bootz.us
Mon Oct 22 20:59:03 EDT 2012


Thanks guys, I can't wait to play with these scripts.

On 10/22/2012 03:36 PM, Robert Dege wrote:
> Just off the top of my head:
>
> #!/bin/csh -f
> set DIR=/usr/whatever
>
> foreach ITEM (`find $DIR -type f -exec file {} \; | grep ASCII | cut 
> -d\: -f1`)
>   lpr $ITEM
> end
>
>
> -Rob
>
>
> On Mon, Oct 22, 2012 at 2:50 PM, Steve Castelli 
> <scastelli at roadrunner.com <mailto:scastelli at roadrunner.com>> wrote:
>
>     Bug Fix -
>     ------------------------------------------------------------------------------
>
>     #!/usr/bin/python
>     """
>     Print text files, recursing sub directories, given a starting
>     directory
>     """
>     import os, string
>     # this is the top of the directory tree
>     startingDirectory = "//etc/"
>     # change lpr prameters as needed
>     lprParameters = "-aprameter" # this is a dummy parameter
>     # Print file of this type - add types as needed
>     fileTypesToPrint = ("conf","txt","sh")
>     for root, dirs, files in os.walk(startingDirectory):
>         for theFile in files:
>             # split file name using a period and make a list
>             fileNameSplit = string.split(theFile,".")
>             # look at the file extension - what is after the last period
>             if fileNameSplit[-1] in fileTypesToPrint:
>                 commandString = "lpr " + lprParameters + " " + root +
>     "/" + theFile
>                 print(commandString)
>                 # uncomment next line after testing
>                 #os.system(commandString)
>     ------------------------------------------------------------------------------
>
>
>
>
>     On 10/21/2012 10:46 PM, eric at bootz.us <mailto:eric at bootz.us> wrote:
>>     Has anyone ever come across a script that recurses through sub
>>     directories omitting any binaries or libraries and then sending
>>     just the ascii files to a printer?
>>
>>     Thanks,
>>     Eric
>>
>>     _______________________________________________
>>     Users mailing list
>>     Users at wnylug.org <mailto:Users at wnylug.org>
>>     http://wnylug.org/mailman/listinfo/users_wnylug.org
>>
>
>
>     -- 
>     Steve Castelli
>     scastelli at roadrunner.com  <mailto:scastelli at roadrunner.com>
>
>
>     _______________________________________________
>     Users mailing list
>     Users at wnylug.org <mailto:Users at wnylug.org>
>     http://wnylug.org/mailman/listinfo/users_wnylug.org
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at wnylug.org
> http://wnylug.org/mailman/listinfo/users_wnylug.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://wnylug.org/pipermail/users_wnylug.org/attachments/20121022/cfda388a/attachment.html>


More information about the Users mailing list