Help with shell script to find sum of first n numbers of Fibonacci series
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, algorithms:
3. The attempts at a solution (include all code and scripts):
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
D.G Ruparel College(Mumbai University),Mumbai(Maharashtra),India
Professor Puja Tambe and Computer Science
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Last edited by DukeNuke2; 03-28-2010 at 09:41 AM..
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)
hi,
I'm a beginner to UNIX and got some problem in this fibonacci.Please help me out.Here is the code:
fibo()
{
if
then
fibo=` expr {fibo ($1 - 2)} + {fibo ($1 - 1)}` | bc
echo $fibo
fi
}
echo "enter a number:"
read x
#echo "The fibonnacci series for value $x is:"
fibo $x
... (4 Replies)
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)
Hi,
My requirement is I have an input file with a continuous series from 10000 to 99999. I have some numbers missing from those series. I want a output file which produces those missing numbers.
Eg: 10002, 99999 are missing from the series then the output file should contain those... (4 Replies)
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)
Hello, I am a beginner to shell programming. Coded the following for Fibonacci series.
#!/bin/bash
fib() {
i=0
j=1
arr=0
arr=1
echo "enter the limit:"
read n
while
do
fo= expr $j - 1
f1=$j
f2= expr $j + 1
arr= expr ${arr} + ${arr}
echo ${arr} (3 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)
Discussion started by: Elly
5 Replies
LEARN ABOUT OSF1
lmfsetup
lmfsetup(8) System Manager's Manual lmfsetup(8)NAME
lmfsetup - License Management Facility (LMF) registration script
SYNOPSIS
/usr/sbin/lmfsetup [template]
DESCRIPTION
You use the lmfsetup script to register data supplied by a Product Authorization Key (PAK). The lmfsetup script prompts you for the data
associated with each field on a PAK. Once you enter all the data, LMF makes sure you have supplied entries for all mandatory fields and
that the value in the Checksum field validates the license data. If all data is correct, LMF registers the PAK in the License Database. If
any data is incorrect, LMF displays the appropriate error message and gives you an opportunity to reenter the data.
The template argument allows you to register license data from templates in /usr/var/adm/lmf. The templates stored in this directory are
created by some software products during their installation process. When you use a template, the script prompts you to supply data for any
empty fields in the template. If the lmfsetup script cannot find the specified template in /usr/var/adm/lmf, it searches your current work-
ing directory.
Use the lmfsetup script when you want to register a PAK without using an editor. Normally, you should use the lmf register command. The
lmf register command displays a template, which includes the fields on the PAK, and invokes an editor so that you can add the license data
to the appropriate fields. The lmf register command allows you to correct errors without having to reenter all the data.
SEE ALSO
Command: lmf(8)
Software License Management
lmfsetup(8)