You are here: Re: TCL/PHP/XML problem: I need to convert an XML file into a TCL list « All PHP « IT news, forums, messages
Re: TCL/PHP/XML problem: I need to convert an XML file into a TCL list

Posted by Bryan Oakley on 11/25/06 15:54

comp.lang.tcl wrote:
> set cannotRunPHP [catch {exec "echo '$php' | php" >@stdout
> 2>&stderr} errorMsg]

You need to re-read the man page on exec. The first argument to exec is
a filename that will be exec'd; it is not a command line. If you want to
run a command line you should exec a command line processor (/bin/sh,
command.com, whatever).

Since "php" is what you want to exec, and $php is what you want to send
to its stdin, use "<<" (documented on the exec man page):

if {[catch {exec php << $php} result]} {
puts "error exec'ing php: $resulut"
} else {
puts "php result: $result"
}

You can read a wiki page on the subject here: http://mini.net/tcl/exec

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация