I am trying to write a generic function (such as Now the sample works however, sometimes the evaluation line After the It is hard to figure out what causes sporadic failure in your case However, There are some things you want to change: : returns: holder ) - which will take the first parameter The name calls another function name (such as
f1, f2, f3, f4 ... ) and based on certain condition.
#! / Bin / ksh function f1 {echo "F1" return 7} function F2 {echo "F2" return 8} function holder {1 `fptr = $ $ {like fptr}} = rate $? Retractor $ ret. Holder "f1" holder "f2"
$ {fptr} Strange failures occur with the details of the stack. I suspect that the way I am calling a function can be some problems. A sample is duplicate code above the code, the actual code contains complex
f1, f2 logic.
eval instead of backlit.
$ 0
< Code> function F1 {echo $ 0 return 7} function F2 {echo $ 0 return 8} function holder {eval "$ 1" resonance $? } Holder "F1" holder "F2"
f1 7 f2 8
No comments:
Post a Comment