lua-users home
lua-l archive

When "#!/usr/bin/env lua" doesn't cut it

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


Hi,
I find myself often using the shebang to start a Lua script:
 #!/usr/bin/env lua
 print "hello"
But now and then one needs more flexibility. Be it that you want to use a different lua interpreter than found in the PATH or /usr/bin/env doesn't exist for your platform, et cetera. 
This is what I came up with to solve this problem:
 #!/bin/sh
 A=--[[
 # here be your adjustments
 exec lua "0ドル" "$@"
 ]]A
 print "hello"
I hope it's useful to anyone.
 Jörg

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