From help-octave-request at bevo dot che dot wisc dot edu Thu Jan 21 16:34:30 1999 Subject: Octave script question From: Andy Adler To: help-octave at bevo dot che dot wisc dot edu Date: Thu, 21 Jan 1999 17:30:09 -0500 (EST) I'm writing a script to convert a file from jpg to another utility, using octave. here's the code ______________________________ #!/usr/local/bin/octave -qf fn= argv(1,:); img= jpgread(fn); [m,n]= size(img); fwrite(stdout, [floor(m/256); rem(m,256); floor(n/256); rem(n,256) ], 'uchar' ); fwrite(stdout, img(:) ,'uchar'); ________________________________ jpgread is a function that I wrote. If I write to a file instead of stdout, then it works fine, but if I call sh>./scriptname jpgfile.jpg > jnkfile then I only get 3 characters in jnkfile. m=320;n=240; to the first 3 characters should be 1 64 0, but instead they're 1 64 10. If seems that some character (0) is acting as an EOF for octave. Is that right? Does the pager need to be disabled? _____________________________________________________________________ Andy Adler | American Biometric Company | Tel:(613)736-5100x154 aadler at abio dot com| | 3429 Hawthorne Rd,Ottawa,ON | 3429 Hawthorne Rd,Ottawa,ON | Fax:(613)736-1348