This is a really nice program.
$ cat fread
#!/usr/local/bin/lua
while true do
local line = io.read()
if line then -- instead of line ~= nil
print(line)
end
if not line then break end
end
It reads each line and prints it out.
Run it like this:
$ ./fread
<type>
.
.
.
<Ctr-D>
Or
$./fread </etc/passwd
I think you can easily follow the code.
I will take you thro' some of the lua rocks or modules in the following week.
We will first look at the interesting socket module.
And we need to also learn lua's coroutines.
I have understood that.
Certain advanced stuff like metatables, weak tables and so on are the
only remaining
items.
And many lua modules have to be looked at.
I certainly want to consider the postgres, SQLite module and many
other utility modules.
Once we advance to that level then we are ready for the talk.
-Girish
--
Gayatri Hitech
http://gayatri-hitech.com