Take a look at my pseudocode, post #5 again.
Your code; there are numerous minor errors and to go through them all before you have solved your project would mean I would be writing it.
Let's get your logic sorted first. You will see from my CODE section how different you logic is from mine.
These lines are fine:
(Just a note, there is no need for the double brackets [[ ]] for this example, single brackets [ ] would suffice. It will still work with double brackets however.)
Again read Don's post #4 thoroughly...
Have another go, and if you increase your "counter" by a certain even number then you will see it all fall into place.
And finally, please use CODE tags, the "</>" icon on the tool bar.
Hi,
i want to sum all nubers in one column. Example:
12.23
11
23.01
3544.01
I'm trying to do this in awk, but it doesn't work properly.
Seems like awk is summing only integers, for example:
12
11
23
3544
It cuts off numbers after dot.
I used this command:
akw /text/ file.txt |nawk... (1 Reply)
hello im looking for short way to sum numbers from stdout the way i found to do it is to long for me i wander if there is shorter way to do it
ok it 2 stage action
this will make the list of number in to file sum.txt
grep -c include *.c | awk '{l=split($0,a,":");print a;}' > sum.txt
this... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Shell script to find sum of first n numbers of Fibonacci series
2. Relevant commands, code, scripts,... (0 Replies)
cat *.out |grep "<some text>" | awk '{print $6}'
For ex,This will reutrn me
11111
22222
is it possible to add these two numbers in the above given command itself?I can write this to a file and find the sum.
But I prefer to this calculation in the above given line itself.
Any... (3 Replies)
I basically have a file where I had to do a bunch of greps to get a list of numbers
example: a file called numbers.txt
10000
10000
superman
10000
batman
10000
10000
grep '100' * |
10000
10000
10000
10000
10000 (2 Replies)
Hi all;
Here is my file:
V1.3=4
V1.4=5
V1.1=3
V1.2=6
V1.3=6
Please, can you help me to write a script shell that counts the sum of values in my file (4+5+3+6+6) ?
Thank you so much for help.
Kind regards. (3 Replies)
I want to count the number of lines, I need this result be a number, and sum the last numeric column, I had done to make this one at time, but I need to make this for a crontab, so, it has to be an script, here is my lines:
It counts the number of lines:
egrep -i String file_name_201611* |... (5 Replies)
I need help with this assignment. I'm very new to using UNIX/LINUX, and my only previous experience with programing anything is using python.
We are writing scripts using vim, and this one I'm stumped on.
"Write a shell script that finds and display the sum of even positive integers from 0 to... (5 Replies)
Discussion started by: Nastybutler
5 Replies
LEARN ABOUT DEBIAN
dbar
dbar(1) User Commands dbar(1)NAME
dbar - ASCII progresbar
SYNOPSIS
echo <percentage> | dbar [options] <indicator text>
DESCRIPTION
dbar lets you define static 0% and 100% marks or you can define these marks dynamically at runtime. Static and dynamic marks can be mixed,
in this case the value specified at runtime will have a higher priority.
You can specify ranges of numbers, negative, positive or ranges with a negative min value and positive max value.
All numbers are treated as double precision floating point, i.e. the input is NOT limited to integers.
OPTIONS -l Label to be prepended to the bar (default: "" ).
-nonl
no new line, don't put '
' at the end of the bar (default: do print "
")
-max
Value to be considered 100% (default: 100).
-min
Value to be considered 0% (default: 0).
-s Symbol represeting the percentage value in the meter (default: "=").
-w Number of charcaters to be considered 100% in the meter (default: 25)
EXAMPLES
Static 100% mark or single value input:
echo 25 | dbar -max 100 -l text
Output: text 25% [====== ]
If your 100% mark changes dynamically or 2-values input:
echo "50 150" | dbar
| |
| |__ max value
|
|__ value to display
Output: 33% [======== ]
If your value range is not between [0, maxval] or 3-values input:
echo "50 -25 150" | dbar
| | |
| | |__ max value 100% mark
| |
| |_____ min value 0% mark
|
|________ value to display
Output: 43% [=========== ]
Multiple runs:
for i in 2 20 50 75 80; do echo $i; sleep 1; done | dbar | dzen2
Output: Find out yourself.
ENVIRONMENT
None.
FILES
None.
SEE ALSO dzen2(1)AUTHORS
Program was written by Robert Manea <rob.manea@gmail.com>.
This manual page was written by Jari Aalto <jari.aalto@cante.net> for the Debian GNU system (but may be used by others). Released under
license GNU GPL version 2 or (at your option) any later version. For more information about license, visit
<http://www.gnu.org/copyleft/gpl.html>.
dbar 2012-04-02 dbar(1)