Hello forum members,
Please wirte a sample program for print the 1 - 100 and 100 -1 using recursive function.
Thanks & regards
Siva Rangnanath (2 Replies)
Hi,
I don't know if you can help or if this is even possible, but I am trying to run the following function over an ssh and (depending on the itteration I choose) keep getting unexpected token or undefined symbol errors.
The function is:
killtree()
{
typeset parent=$1
typeset child... (1 Reply)
I created two functions that output two random variables. I want to output them in the output file. But it does not seem to work.
# Function rgaussian1(r1, r2)
# Gaussian random number generator
function rgaussian1(r1, r2) {
pi = 3.142
v1 = sqrt( -2 * log(rand()) )
v2... (18 Replies)
I am facing some problem in perl recurssive function function
my @array_parent = (Some inegers);
my $outputfile = 'output.txt';
my $master_file = 'master.txt';
open (MASTER,"$>>master.txt");
foreach my $child (@array_parent){
my $line = `grep "$child" "$outputfile"`;
... (1 Reply)
I have the following function in a bash script that fails to return the sorted array. I think the problem lies in the recursion not correctly passing the arrays, but I can't tell what I'm doing wrong. Anyone see the problem?
function quicksort () {
local array=( `echo "$1"` )
local... (7 Replies)
Actually I got a list of file end with *.txt
I want to use the same command apply to all the *.txt
Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics.
For example:
I got the file below:
file1.txt
file2.txt
file3.txt... (4 Replies)
Can someone tell me, how do i write a recursive code using shell ( eg like 'for' loop in C) which outputs the record to a database table as one row per iteration? (7 Replies)
This is shell script I have made to lists out directory contents and filenames for any given directory (without using ls command). There is some problem in dirfunc function call which I have marked 1 is not working. Can anybody suggest what is the problem there and how should I correct it.
... (2 Replies)
Hi all,
I have to move all the files in a tree directory structure to a single directory. Inorder to know which file is from which directory , i'll have to add the name of the directory to the file name. For this i wrote a recursive function which is as follows... (4 Replies)
Hi everyone, i need your input on this. We can express a function recursivly like this
A(n) = (2 n = 0
5 n = 1
A(n − 1) + A(n − 2) % 47 n > 1
How would i go about constructing a recursive function for this?... (1 Reply)