Re: Bourne Shell Script Newbie Help

From: Daz (htpw16_at_hotmail.com)
Date: 01/17/04


Date: 17 Jan 2004 01:08:49 -0800

Ed Morton <morton@lsupcaemnt.com> wrote in message news:<bu49ag$8ab@netnews.proxy.lucent.com>...
> Daz wrote:
> > Hello Group, I need some assistance in starting an assignment.
>
> Write high-level pseudo-code describing how to solve the problem, then
> use top-down refinement to get it down to a fairly low level of detailed
> textual instructions, then read the course notes to see how to perform
> those instructions in shell.
>
> Many manual pages are on-line at
> http://www.opengroup.org/onlinepubs/007904975/idx/index.html
>
> and the FAQ for this group is at
> http://www.newsville.com/cgi-bin/getfaq?file=comp.unix.shell/comp.unix.shell_FAQ_-_Answers_to_Frequently_Asked_Questions
>
> Once you've made an attempt to solve the problem yourself, feel free to
> come back to ask for input.
>
> Ed.

Alright,
Ive been working this assignments for a few days now and got stuck on
a small section of it.So this small problem, which you may laugh at,
is as follows.

The section asks for me to read lines from a file so I can calculated
the average and median etc.

For example the input file looks like this:
1 2 3 4 5
6 7 8 9 10
etc..... and so on

I understand the read concept enough so that I can only read the first
line in the file. And I understand the wc command returns the number
of numbers in the file(to compute the average).

However,

1) Problem 1: I cant seem to be able to read any lines other than
first.

2) Problem 2: I dont know how, after reading the lines, to split the
numbers up so I can calculate the average of line 1, line2 etc........

Hopefully you can assist me in this.
Thanks



Relevant Pages

  • Re: HELP!!!
    ... & sort the input file into 3 output files by ... Code the problem in Java using 1 file input stream and 3 file output ... Submit your 3 output files. ... Turn in your assignment by the end of class tonight for full credit. ...
    (comp.lang.java.help)
  • Re: Howto construct a message for a simple WebService call?
    ... A very good answer, but still, I would like to see sample code to that ... >> to use the construct message shape to transform the input FILE to a web ... > When BizTalk imports a WSDL, it will create Multi-part message types for the ... > Assignment shape. ...
    (microsoft.public.biztalk.general)
  • Re: HELP!!!
    ... (note file path when copying file from web to your usb) ... & sort the input file into 3 output files by ... Submit your 3 output files. ... Turn in your assignment by the end of class tonight for full credit. ...
    (comp.lang.java.help)
  • Re: HELP!!!
    ... (note file path when copying file from web to your usb) ... & sort the input file into 3 output files by ... Submit your 3 output files. ... Turn in your assignment by the end of class tonight for full credit. ...
    (comp.lang.java.help)
  • Re: HELP!!!
    ... (note file path when copying file from web to your usb) ... & sort the input file into 3 output files by ... Code the problem in Java using 1 file input stream and 3 file output ... Turn in your assignment by the end of class tonight for full credit. ...
    (comp.lang.java.help)