[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua as replacement for Bash scripting
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 5 Jul 2010 12:56:34 -0300
> 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)