lua-users home
lua-l archive

Re: Execute linux command on Lua and get the result

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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' )

AltStyle によって変換されたページ (->オリジナル) /