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 !
I need some help with my simple bash script.
This script removes all files ( with name given in $1 ) in current dir and subdirectories .
The problem is with first loop in the script ( for file in * ; do ) .
When I run the sript in my home directory this script display sometimes( ... (5 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, I'm trying to create a script that will display the contents of the users directories, but i'm confused about how to incorporate the shift properly.
The problem I'm getting with my script is that it goes throught the first couple of directories but then returns an error as it loses the... (10 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)
So the problem I am having is recursion with in bash. Specifically the program ideally takes either the current or provided directory, lists out everything in that directory, if it finds another directory the script should call itself and go into that directory. I managed to get it to dive into the... (6 Replies)
Discussion started by: mistsong1
6 Replies
LEARN ABOUT PHP
locale_get_display_name
LOCALE_GET_DISPLAY_NAME(3) 1 LOCALE_GET_DISPLAY_NAME(3)Locale::getDisplayName - Returns an appropriately localized display name for the input locale
Object oriented style
SYNOPSIS
publicstatic string Locale::getDisplayName (string $locale, [string $in_locale])
DESCRIPTION
Procedural style
string locale_get_display_name (string $locale, [string $in_locale])
Returns an appropriately localized display name for the input locale. If is NULL then the default locale is used.
PARAMETERS
o $locale
- The locale to return a display name for.
o $in_locale
-optional format locale
RETURN VALUES
Display name of the locale in the format appropriate for $in_locale.
EXAMPLES
Example #1
locale_get_display_name(3) example
<?php
echo locale_get_display_name('sl-Latn-IT-nedis', 'en');
echo ";
";
echo locale_get_display_name('sl-Latn-IT-nedis', 'fr');
echo ";
";
echo locale_get_display_name('sl-Latn-IT-nedis', 'de');
?>
Example #2
OO example
<?php
echo Locale::getDisplayName('sl-Latn-IT-nedis', 'en');
echo ";
";
echo Locale::getDisplayName('sl-Latn-IT-nedis', 'fr');
echo ";
";
echo Locale::getDisplayName('sl-Latn-IT-nedis', 'de');
?>
The above example will output:
Slovenian (Latin, Italy, Natisone dialect);
slovxc3xa8ne (latin, Italie, dialecte de Natisone;
Slowenisch (Lateinisch, Italien, NEDIS)
SEE ALSO locale_get_display_language(3), locale_get_display_script(3), locale_get_display_region(3), locale_get_display_variant(3).
PHP Documentation Group LOCALE_GET_DISPLAY_NAME(3)