lua-users home
lua-l archive

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


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:

  # here be your adjustments
  exec lua "$0" "$@"

  print "hello"

I hope it's useful to anyone.