Is there something that can transform a program made with php to shell-script?
I would to know if there is a program that can transform a source originally made with php to shell-script?
I think the problem is the html, forms and thinks like this. I almost didn't used javascript, so i think this would not be a problem. |
Hi
I often write shell scripts, and since i'm confortable with PHP i prefer it to bash and the likes. On Debian first apt-get install php4-cli Note it installs a separate php.ini file you might want to edit. Then just prefix your scripts with path to php, like e.g. #!/usr/bin/php <?php echo "Hi there"; ?> Make the file executable, and you have a shell script. Hope this helps, Guttorm. |
But, how about forms and thinks like this. Will it appear?
|
When you execute the shell script, it will display HTML, if that's what the program outputs.
Shell scripts are usually not very user interactive - I don't think I understand what you're trying to do. If you need HTML rendering, I dont think there's another way except thru a web-server and using a browser. It would be possible to output the HTML and then get the HTML rendered in a web-broswser, but is that really a shell-script? If you need a lot of interactivety, you need to rewrite everything that has to do with output and input from the users. I suggest looking into ncurses, http://www.php.net/manual/en/ref.ncurses.php |
you can interact with STDIN like you would a normal file.. somthing like this..
Code:
$input = fread(STDIN, $buffer_size); http://us3.php.net/features.commandline and google on php cli |
All times are GMT -5. The time now is 06:32 AM. |