script

Embedded Lua-Script into C

Sven Bachmann
This weekend, I played around a bit with Lua and C. My aim was to understand the Lua basics, embed the script engine into C and be able to even call a C function from Lua. With Google and a lot of documentation spread around the web this was a fairly easy task. The result are 2 short files. First file is the C-code main.c which initializes Lua, registers the C-function which will be later called by Lua and then executes the Lua-script.

Unzip/unrar multiple files with file-specific folders

Sven Bachmann
Hi, if you want to unzip/unrar multiple files in a directory, but want to create a special folder for each content, you can use the following bash-code. #!/bin/bash IFS=' ' # ZIP files for i in `ls *zip`; do DIRNAME=${i%.zip} mkdir $DIRNAME cd $DIRNAME unzip ../$i cd .. done # RAR files for i in `ls *rar`; do DIRNAME=${i%.rar} mkdir $DIRNAME cd $DIRNAME rar x ../$i cd .. done Bye Sven