The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-15-2008
era era is online now
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 2,912
You need to parse the output from your C program, or make its output format less complex. The fact that it might not always print a value for k seems like a slightly dubious design, if that's what it's primarily useful for. Also I'd centralize all the printing to one function, and make pline() only calculate and return the desired value (for printing or other use).

The last line of output will be in $s[-1] if that's the only output you are really interested in.
Reply With Quote