[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: When "#!/usr/bin/env lua" doesn't cut it
- From: Richter, Jörg <Joerg.Richter@...>
- Date: Wed, 22 Jul 2009 11:42:48 +0200
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