[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: bash script to strip comments?
- From: Sean Conner <sean@...>
- Date: Tue, 9 Nov 2010 16:54:11 -0500
It was thus said that the Great Valerio Schiavoni once stated:
> Hello
> is there anyone who hash a script (bash or others) that takes a .lua file
> and strips out all the comments (block, multiline, single line) ?
Would the following do the trick?
-spc
#!/bin/bash
# You have to supply a filename, sans the ".lua" extension, else this will
# bomb out I don't know enough bash scripting to fix this. Think of this as
# a "proof-of-concept".
cat <<EOF >$1
#!/usr/bin/env lua
EOF
luac $1.lua
cat luac.out >>$1
/bin/rm luac.out
chmod 755 $1
exit 0