lua-users home
lua-l archive

Re: make local oddness and package.prefix

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


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

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