Re: Calculate percentages
From: Tony Lawrence (foo_at_pcunix.com)
Date: 10/24/05
- Next message: Brian K. White: "Re: Calculate percentages"
- Previous message: Ian Wilson: "Re: Calculate percentages"
- In reply to: Dion: "Re: Calculate percentages"
- Next in thread: Brian K. White: "Re: Calculate percentages"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 24 Oct 2005 06:00:16 -0400
Dion wrote:
> If you have read my query, which I'm sure you haven't, I didn't ask for
> the solution but for advice. Sometimes is better to think before
> talking! Since you are not able to give any advice, stop pretending
> being a smart guy!
>
That's great - be insulting.
But just in case you aren't as stupid as you seem, I'll take the above
as real.
First, you need to know how to create a shell script. See
http://aplawrence.com/Basics/scripting.html if you don't.
Next, you need to count lines. Start with "man wc". You need to
differentiate between comment lines and non-comment lines: "man grep".
But if you really want to impress your professor, I'd suggest you
submit an alternate solution using the shell's "read" function, and
"test" and "expr" (or built in math if you are allowed to use bash or
ksh). Finally, you should do one in awk and one in Perl.
You should look at "man bc" and "man dc" also, just for completeness.
If you really investigate all I've suggested here, you'll learn quite a bit.
-- Tony Lawrence Unix/Linux/Mac OS X resources: http://aplawrence.com Geek Yard Sale: http://geekyardsale.com
- Next message: Brian K. White: "Re: Calculate percentages"
- Previous message: Ian Wilson: "Re: Calculate percentages"
- In reply to: Dion: "Re: Calculate percentages"
- Next in thread: Brian K. White: "Re: Calculate percentages"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|