lua-users home
lua-l archive

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


On Apr 7, 2014, at 10:01 PM, Philipp Janda <siffiejoe@gmx.net> wrote:

> What's wrong with `lua < file.lua`?

Arghhh… nothing :)

Used to use ‘-‘ as in:

  -        stop handling options and execute stdin

Never noticed it working without ‘-‘ :))

> Well, if I have to deal with an application directory (scripts, modules, and support files bundled together in a directory -- which is *the* use case for `require_here`), I almost always use a symlink to put the scripts into my `$PATH`, so ... not good enough for me[*].

I recently developed the habit of starting my Lua script as such:

#!/bin/bash

SELF=$(readlink /proc/$$/fd/255)
SELFNAME=$(basename $SELF)
BASEDIR=$(dirname $SELF)

$LUABIN - ${SELFNAME} ${BASEDIR} "$@" <<\EOF

EOF

(Don’t ask)