[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: godawful sh/Lua polyglot
- From: Norman Ramsey <nr@...>
- Date: Wed, 12 Aug 2020 13:27:43 -0400
I'm working on a file that is simultaneously a ksh script and a pandoc
Lua filter. In case someone else finds it useful to have a shell script
and a Lua script be the same file, here's how it opens:
#!/bin/ksh
if false
then --[[
else
case $# in
0) pandoc --lua-filter="$0" ;;
*) pandoc --lua-filter="$0" "$@" ;;
esac
exit $?
fi
]]
end
... Lua code follows ...