Enhance shebang handling in REPL and source code execution to preserve line numbers
This commit is contained in:
21
new_proj.luash
Normal file
21
new_proj.luash
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env luash
|
||||
|
||||
-- Environment variables (clean syntax)
|
||||
print("Hello " .. $USER .. "!")
|
||||
|
||||
-- Variable assignment
|
||||
$MY_VAR = "some value"
|
||||
|
||||
-- Shell commands with backticks
|
||||
files = `ls -la`
|
||||
current_dir = `pwd`
|
||||
|
||||
-- Interactive commands
|
||||
!ls
|
||||
|
||||
-- The power of Lua + shell
|
||||
if `test -f README.md` ~= "" then
|
||||
lines = `wc -l < README.md`
|
||||
print("README has " .. lines .. " lines")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user