[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Execute linux command on Lua and get the result
- From: Petite Abeille <petite.abeille@...>
- Date: Mon, 27 Aug 2012 21:06:34 +0200
On Aug 27, 2012, at 8:38 PM, Felipe Oliveira Gutierrez <lipe.82@gmail.com> wrote:
> key=os.execute('xmlstarlet sel -t -v "/account_out/authenticator"
> /var/lib/boinc-client/lookup_account.xml')
Try io.popen:
http://www.lua.org/manual/5.2/manual.html#pdf-io.popen
For example:
local aCommand = ( '%s -x %s < %s' ):format( reformail, Quote( 'message-id:' ), Quote( aMailPath ) )
local aHandle = assert( io.popen( aCommand , 'r' ) )
local aHeader = aHandle:read( '*l' )