niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » shell
can I call a internal function directly?
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
minrobin@gmail.com
*nix forums beginner


Joined: 21 Jul 2006
Posts: 2

PostPosted: Fri Jul 21, 2006 2:17 am    Post subject: can I call a internal function directly? Reply with quote

Hi, guys,
I have some code like this:

#! /bin/sh

func1(){
echo "func1......."
func2(){
echo "---->func2"
}
echo "............"
}

so , I have one question. can I call internal function func2 directly?
or how can I get func2's id, for example in other
languege,"func1.func2" or "func1->func2" or "func1#func2" ,etc.

any sugestion will be appreciated. thank your help.
Back to top
Chris F.A. Johnson
*nix forums Guru


Joined: 20 Feb 2005
Posts: 2268

PostPosted: Fri Jul 21, 2006 2:30 am    Post subject: Re: can I call a internal function directly? Reply with quote

On 2006-07-21, minrobin@gmail.com wrote:
Quote:
Hi, guys,
I have some code like this:

#! /bin/sh

func1(){
echo "func1......."
func2(){
echo "---->func2"
}
echo "............"
}

so , I have one question. can I call internal function func2 directly?
or how can I get func2's id, for example in other
languege,"func1.func2" or "func1->func2" or "func1#func2" ,etc.

Once you have called func1, func2 will be defined. Then you can
call it as you would any other function. Until then, you cannot
call it.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Back to top
minrobin@gmail.com
*nix forums beginner


Joined: 21 Jul 2006
Posts: 2

PostPosted: Fri Jul 21, 2006 3:16 am    Post subject: Re: can I call a internal function directly? Reply with quote

Ooooooooooo,It is so great!
Thank you, Chris.


Chris F.A. Johnson 写道:

Quote:
On 2006-07-21, minrobin@gmail.com wrote:
Hi, guys,
I have some code like this:

#! /bin/sh

func1(){
echo "func1......."
func2(){
echo "---->func2"
}
echo "............"
}

so , I have one question. can I call internal function func2 directly?
or how can I get func2's id, for example in other
languege,"func1.func2" or "func1->func2" or "func1#func2" ,etc.

Once you have called func1, func2 will be defined. Then you can
call it as you would any other function. Until then, you cannot
call it.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 2:52 pm | All times are GMT
navigation Forum index » Programming » shell
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Filtering internal mail and forwarding to another domain fmaa1 Postfix 0 Wed Apr 30, 2008 12:50 pm
No new posts Function Pointer Sikandar C 3 Fri Jul 21, 2006 1:23 pm
No new posts Arbitrary function with parameter darknails@gmail.com C++ 2 Fri Jul 21, 2006 9:58 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com apps 4 Fri Jul 21, 2006 3:22 am
No new posts Is there C/C++ corresponding function in Linux for Java's... xiebopublic@gmail.com C++ 1 Fri Jul 21, 2006 2:44 am

Property in Spain | Debt Consolidation | Loans | Mortgage Calculator | Discount Magazines
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1293s ][ Queries: 16 (0.0533s) ][ GZIP on - Debug on ]