9 More Discussions You Might Find Interesting
1. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Write a shell script that finds and display the sum of even positive integers from 0 to 100. Use the while control structure. Show your script and a sample run.
2. Relevant commands, code, scripts, algorithms:
Must us a while... (8 Replies)
Discussion started by: Nastybutler
8 Replies
2. Shell Programming and Scripting
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)
Discussion started by: Elly
5 Replies
3. Shell Programming and Scripting
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)
Discussion started by: chercheur111
3 Replies
4. Homework & Coursework Questions
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:
I am trying to convert a C language program over to Sparc Assembley and I am getting Undefined first referenced... (4 Replies)
Discussion started by: kenjiro310
4 Replies
5. Shell Programming and Scripting
I want to make a script which takes the number of argument, add those argument and gives output to the user, but I am not getting through...
Script that i am using is below :
#!/bin/bash
sum=0
for i in $@
do
sum=$sum+$1
echo $sum
shift
done
I am executing the script as... (3 Replies)
Discussion started by: mukulverma2408
3 Replies
6. Homework & Coursework Questions
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)
Discussion started by: Kshitija
0 Replies
7. Shell Programming and Scripting
I am facing problem with Shell script to generate Fibonacci series using recursion i.e. recursive function.
Here is my script:
#!/bin/sh
fibo()
{
no=$1
if ; then
return 0
elif ; then
return 1
else
a1=`expr $no - 1`
fibo $a1
... (10 Replies)
Discussion started by: Tapas Bose
10 Replies
8. Shell Programming and Scripting
I have a command which returns some numbers as follows:
$ls -l ${dbname}.ix* | awk '{print $5 }'
929792
36864
57344
73728
53248
114688
How can I find the sum of those numbers by piping this output into 'awk' or some other editor/command? Thanks a lot -A (3 Replies)
Discussion started by: aoussenko
3 Replies
9. Shell Programming and Scripting
Hi Can any one please post the answer for the above program.................. (4 Replies)
Discussion started by: banta
4 Replies