Hey Rob,

I indirectly reported this on a separate thread, but here's a more complete bug 
report,
with steps to reproduce.

If I define a shell function in bash, I can execute the function by putting its 
name
in a variable, and then retrieving the value of the variable at the shell 
interpreter prompt,
like so:

On my desktop machine, running the bash shell:
tbird@timdesk:~$ myfunc() {
> echo "inside myfunc"
> }
tbird@timdesk:~$ myfunc
inside myfunc
tbird@timdesk:~$ VAR="myfunc"
tbird@timdesk:~$ $VAR
inside myfunc

This doesn't work with the toybox shell.  I get "sh: <func_name>: No such file 
or directory"

When running a toybox shell under qemu, I get the following:
$ myfunc() {
> echo "inside myfunc"
> }
$ myfunc
inside myfunc
$ VAR="myfunc"
$ $VAR
sh: myfunc: No such file or directory
$ 

Note that executing an internal or external command from a variable reference 
works:
$ VAR="echo hello"
$ $VAR
hello
$ VAR="cat /etc/passwd"
$ $VAR
root:x:0:0:root:/root:/bin/sh
guest:x:500:500:guest:/home/guest:/bin/sh
nobody:x:65534:65534:nobody:/proc/self:/dev/null
$ 

Thanks,
 -- Tim

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to