I'm using the UNIX csh and i wish to use recursion to nav my way up (or down as it is) a given folder.
My little test script is called "r" and takes a folder as argv (or $1)
#!/bin/tcsh -f
set allFiles = `ls -A $argv`
cd $argv
while ($#allFiles)
if (-d... (1 Reply)
I am running a korn shell script which has a recursive function.
The script ran for 117 iterations and ended up with the following error
"recursion too deep".
what should be done to avert this?
Thanks in advance
Swamy
p.s. I am on UNIX MPRAS V4 (3 Replies)
Hello every body. I am trying to find the factorial using the following code. But it is giving the syntax error. I tried very much but in vain. Thanks in advance for helping me
factorial()
{
if
then
y=`expr $1 - 1`
x=$(( $1 \* factorial $y ))... (6 Replies)
I want to halt a tail recursive function after certain validation. I want to come out of entire recursion without unwinding phase. How can i achieve that . The coding is done in C language. (5 Replies)
Hi Guys,,
I tried to create a recursive function in unix.
The following is the code.
#/bin/sh
function(){
n=$1;
if ; then
out=1;
echo "inside if for 0";
else
out = `$n * function "$n-1"`;
echo "inside if for $n-1;
fi (3 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,
Question: how come the output is like that? Can explain to me abit. I am learning C.
Thanks!
#include <stdio.h>
#include <string.h>
void printit(char line_of_char, int index);
int main()
{
char line_of_char;
int index = -1;
strcpy(line_of_char, "This is a string.");
... (5 Replies)
Can someone please explain me why the following script calls it self recursively:
#!/bin/bash
echo Called
$0
while this not:
#!/bin/bash
echo Called
$($0)
Thanks (6 Replies)
Not sure how to ask this question. I want concatenate strings and variable recursively into new variable. For example:
infile01=/dir/subfolder/file01.txt
infile02=/dir/subfolder/file02.txt
infile03=/dir/subfolder/file03.txt
for i in {01..03}
do
u=${"infile"$i}
echo $u
doneI got error... (7 Replies)
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Discussion started by: siegfried
3 Replies
LEARN ABOUT SUSE
set_color
set_color(1) fish set_color(1)NAME
set_color - set_color - set the terminal color
set_color - set the terminal color
Synopsis
set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR]
Description
Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple,
cyan, white and normal.
o -b, --background Set the background color
o -c, --print-colors Prints a list of all valid color names
o -h, --help Display help message and exit
o -o, --bold Set bold or extra bright mode
o -u, --underline Set underlined mode
o -v, --version Display version and exit
Calling set_color normal will set the terminal color to whatever is the default color of the terminal.
Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey
font color, while set_color --bold white will result in a white font color.
Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator.
set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and
incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of
ncurses and recompile fish against it in order to fix this issue.
Version 1.23.1 Sun Jan 8 2012 set_color(1)