LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Strange behaviour with bash printing script and Matrix.java[Scanned]

[ILUG] Strange behaviour with bash printing script and Matrix.java[Scanned]

Cormac McClean cmcclean at ait.ie
Mon Dec 18 16:01:27 GMT 2006


Hi Padraig,

 > I presume you edited the A12354678 above to all have the same number?
Yes, rather than publish actual student IDs.

 > If so is it expected that they're all exactly 3KiB?
Interesting point. The original files vary in size from 2149 to 2927 
bytes. Hmmm...

 > As an aside, your script is probably more robust like:
Thanks for that.

Regards,
Cormac.

Pádraig Brady wrote:
> Cormac McClean wrote:
> 
>>Hi,
>>
>>I raise this as much for its strangeness as for a request for help.
>>
>>I have a bash scipt which I use to print out submitted Java assignments
>>from students. The script (included below) goes through each jar file -
>> - which will be of the form A12345678.jar representing the student's ID
>>- in the current directory, creates a new directory for it, moves the
>>jar file into it, extracts the contents, lists each of the java source
>>code files and prints them using lp and the pretty-print option.
>>
>>It works fine, except for a file in each jar file called Matrix.java,
>>which get queued, but refuse to print. Here's the print queue after all
>>other (20+) files have printed:
>>
>>HPLaserJet is ready
>>Rank    Owner   Job     File(s)                         Total Size
>>1st     cmcclea 979     A12354678 Matrix.java           3072 bytes
>>2nd     cmcclea 986     A12354678 Matrix.java           3072 bytes
>>3rd     cmcclea 993     A12354678 Matrix.java           3072 bytes
>>4th     cmcclea 1000    A12354678 Matrix.java           3072 bytes
> 
> 
> I presume you edited the A12354678 above to all have the same number?
> If so is it expected that they're all exactly 3KiB?
> 
> As an aside, your script is probably more robust like:
> 
> for jar in  *.jar; do
>     id=`basename "$jar" .jar`
>     echo "$id"
>     mkdir -p "$id"
>     (
>     cd "$id"
>     jar -xf "../$jar"
>     for java in *.java; do
>         echo $id $java;
>         lp -o prettyprint -o media=A4 -o page-left=15 -o page-top=10 -o page-right=10 -o page-bottom=10 -t "$id $java" $java;
>     done
>     )
> done
> 
> Pádraig.
> 
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
> 

The information contained in this email is confidential and is designated solely for the attention of the intended recipient(s). If you have received this email in error, please do not use or transmit it for any purpose but rather notify us immediately and delete all copies of this email from your computer system(s). Unless otherwise specifically agreed by our authorised representative, the views expressed in this email are those of the author only and shall not represent the view of or otherwise bind Athlone Institute of Technology. Contact administrator at ait.ie or telephone 090 6471858.

_____________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell