Jump to content

Lua: Difference between revisions

From Official NixOS Wiki
imported>Makefu
Created page with "== #! nix-shell with lua interpreter == To use a nix-shell shebang with lua you will need to use following structure: <syntaxHighlight lang=lua> #! /usr/bin/env nix-shell --[..."
(No difference)

Revision as of 07:02, 14 October 2021

#! nix-shell with lua interpreter

To use a nix-shell shebang with lua you will need to use following structure:

#! /usr/bin/env nix-shell
--[[
#! nix-shell -i lua -p lua
]]

print("this is from lua")

Some background by samueldr:

   Two inter-twined fun facts.
   *    Lua only skips one shebang line.
   *    nix-shell doesn't require its magic lines to be right after the first line.