[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: make local oddness and package.prefix
- From: Luis Carvalho <carvalho@...>
- Date: Mon, 13 Mar 2006 10:58:52 -0500
> To find the current lua version, one simply types:
>
> $ lua -v 2>&1 | awk '{print $2}'
lua -e 'print(string.match(_VERSION,"Lua (.*)"))'
> So far, the best way I know how to find the current lua prefix is:
>
> $ lua -e 'print(package.path)' \
> | awk -F\; '{print $2}' \
> | sed 's-/share/lua/5\.1/?\.lua--'
lua -e 'print(string.match(package.path,".*;(.*)/share.*"))'
What do you think? It's certainly more portable. ;)
Cheers,
luis.
--
A mathematician is a device for turning coffee into theorems.
-- P. Erdos
--
Luis Carvalho
Applied Math PhD Student - Brown University
PGP Key: E820854A <carvalho@dam.brown.edu>