'How to get the home directory in Lua (on GNU/Linux system)?

How to get the home directory in Lua (on GNU/Linux system)?

It's the same thing that I get when I type echo $HOME in shell.

lua


Solution 1:[1]

os.getenv( "HOME" ) should be what you're looking for.

See the docs.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 idbrii