473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

self calling function issue

momotaro
357 100+
Hi,
When I try to call a function1 again inside this same function I get unexpected results!

Expand|Select|Wrap|Line Numbers
  1. case $choixMenu in
  2.     0) PROMPT ;;
  3.     1) echo "$PWD" ;
  4.        MENUFUNCTION ;
  5.     2) echo "Veuillez entrer la nouvelle valeur de PWD";
  6.        read PWD;
  7.        echo "$PWD" ;
  8.        MENUFUNCTION ;
  9.   esac
this is MENUFUNCTION :

Expand|Select|Wrap|Line Numbers
  1. function MENUFUNCTION
  2. {
  3.   echo "        [1]-AFFICHER"
  4.   echo "        [2]-MODIFIER"
  5.   echo "        [0]-REVENIR AU MENU PRINCIPAL"
  6.   echo
  7.   echo "        Veillez faire un choix!"
  8.   read choixMenu
  9. }
the issue: when I retype [1] second time (or another) I don't get the result needed it just prompt the choice number...

Thank's in advance
Jan 19 '11 #1
1 1765
horace1
1,510 Expert 1GB
have you forgotten the ;; on the end of lines 4 and 8 in
Expand|Select|Wrap|Line Numbers
  1. case $choixMenu in
  2.     0) PROMPT ;;
  3.     1) echo "$PWD" ;
  4.        MENUFUNCTION ;
  5.     2) echo "Veuillez entrer la nouvelle valeur de PWD";
  6.        read PWD;
  7.        echo "$PWD" ;
  8.        MENUFUNCTION ;
  9.   esac
  10.  
  11.  
Jan 23 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Andrew Wilkinson | last post by:
Hi, First off I know that in almost all cases this would be a terrible thing to do, but this is an unusual case where this makes sense. Basically I have a procedure where you pass a string...
6
by: komal | last post by:
hi all basically my problem is i have to write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function...
6
by: jchao123 | last post by:
Dear All, I have an MDB file (Access 2000/XP) which contains generic routines I use in various apps (eg, API calls, File access classes etc). I have compiled into an MDE file which I reference...
2
by: Tony Liu | last post by:
Hi, I want to get the name of the calling function of an executing function, I use the StackTrace class to do this and it seems working. However, does anyone think that there any side effect...
16
by: Saroj | last post by:
Is there an way for a function to know who called him ?
9
by: kernelxu | last post by:
hi,everybody. I calling function setbuf() to change the characteristic of standsrd input buffer. some fragment of the progrem is: (DEV-C++2.9.9.2) #include <stdio.h> #include <stdlib.h> int...
2
by: Joerg Battermann | last post by:
Hello there, I have a quick question: When calling a function B from within a function A, is it possible get information about the calling function A (e.g. name, values passed over etc) from...
2
by: sumanthsclsdc | last post by:
Hello friends, I have a problem, I implemented a class which uses tkinter and displays the window as required, the class will create a window with listbox and inserts some items into it, I...
4
by: astri | last post by:
#include "Unit1.h" #include "math.h" #include "fixed_math.hpp" #include "algorithm.h" #define MBIT 0x4000 #define CBIT 16 long constbl; void __fastcall TForm1::Button1Click(TObject...
15
by: dspfun | last post by:
Hi, Is it possible to print the function name of the calling function? For example, f1() and f2() both calls f3(), in f3() I would like to print the name of the function calling f3() which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.