I am trying to execute tcl script inside php using passthru function. TCL script perfectly executes on the normal unix terminal. Whereas in php its not giving expected results on the browser.
I am passing the environment variable using passthru function in php. The environment variable is getting passed correctly but I am noticing the rest of the commands are not giving out the result. So I experimented trying to execute ls command and date command.
date
command gives the output on the browser whereas ls
doesn't give any output on the browser.
Why is this happening? It's the same result with who
and other commands with large output. Is there anything I am missing here??
Here is my sample tcl script ls_sample.tcl
puts "entering tcl"
set date_variable [exec date]
puts $date_variable
set ls_variable [exec ls]
puts $ls_variable
Sample output on the browser:
executing tclscript entering tcl Thu Oct 18 23:23:38 PDT 2012
why is ls
not printed? Whereas it works completely fine on the unix terminal?