|
|
|
|
|
|
| Author |
Message |
minrobin@gmail.com *nix forums beginner
Joined: 21 Jul 2006
Posts: 2
|
Posted: Fri Jul 21, 2006 2:17 am Post subject:
can I call a internal function directly?
|
|
|
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
|
Posted: Fri Jul 21, 2006 2:30 am Post subject:
Re: can I call a internal function directly?
|
|
|
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
|
Posted: Fri Jul 21, 2006 3:16 am Post subject:
Re: can I call a internal function directly?
|
|
|
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 |
|
 |
|
|
The time now is Sun Nov 23, 2008 2:52 pm | All times are GMT
|
|
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
|
|