lua-users home
lua-l archive

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


> This:
> 
>   os.execute("test -e '" .. PATH .. "'")
>   io.stdout:write("--> Setting permissions...\n")
> 
> can be rewritten as
> 
>   exec "test -e $PATH"
>   echo "--> Setting permissions...\n"
> 
> under suitable definition of `exec` and `echo`

See also my lcl, which allows execution of command lines and does
$name expansions:
	http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lcl

A typical command line looks like this
	print us $me and $you
and is evaluated in Lua as
	print("us",me,"and",you)