HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux simsoft.ro 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC 2025 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/bin/lua-any
#!/bin/bash
#
# This scripts enables shebang lines like
#
#   #!/usr/bin/env lua-any
#   -- Lua-Versions: 5.1 5.2
#   -- Lua-Root: /usr/bin/lua
#   -- Lua-Args: -l foo
#
# That will pick the first installed interpreter among /usr/bin/lua5.1 and
# /usr/bin/lua5.2 and pass to if '-l foo' as well ass the name of the script
# containing the shebang and the extra arguments
# 
# License: MIT/X
# Copyright: 2015 Enrico Tassi <gareuselesinge@debian.org>

#set -x
set -e

FILE="$1"

if [ -z "$FILE" ]; then
	echo "Error: lua-any needs at least one argument"
	exit 1
fi

VERSIONS="`head "$FILE" | grep -i '^--[[:space:]]*Lua-Versions[[:space:]]*:' \
	| cut -d : -f 2- \
	| sed 's/^[[:space:]]*//' \
	| sed 's/[[:space:]]*$//' `"
ROOT="`head "$FILE" | grep -i '^--[[:space:]]*Lua-Root[[:space:]]*:' \
	| cut -d : -f 2- \
	| sed 's/^[[:space:]]*//' \
	| sed 's/[[:space:]]*$//' `"
ARGS="`head "$FILE" | grep -i '^--[[:space:]]*Lua-Args[[:space:]]*:' \
	| cut -d : -f 2- \
	| sed 's/^[[:space:]]*//' \
	| sed 's/[[:space:]]*$//' `"

if [ -z "$ROOT" ]; then ROOT=/usr/bin/lua; fi

for v in $VERSIONS; do
	if [ -x "$ROOT$v" ]; then
		exec $ROOT$v $ARGS "$@"
	fi
done

echo "Error: no suitable Lua interpreter found"
echo "Error: supported versions are: $VERSIONS"
exit 1