Bash secret powers

This entry is part 2 of 2 in the series Unix swissknife

Bash scripting has evolved a lot in the last ten years.

I get used to relay on bash for all normal “data domination” tasks (like file system refactorings, database extraction and reporting and so on) and switching to python/ruby/perl when the complexity gets bigger. I didn’t imagine bash is even more powerful :) This article by Robert Muth so you new nice tricks: I  add here some other like mapfile and stress the most important one.

Update2016:Last but not least,if you do now know about bash history, this link will teach you a huge set of tricks

Continue reading “Bash secret powers”

Tool Command Language: il papa’ di Java

E’ notizia fresca di stampa il rilascio di Tcl 8.6, che introduce parecchie novità a dispetto del fatto che sia una “minor” release.


In particolatre Tcl 8.6 introduce un motore “stackless”, integra nel linguaggio le estensioni OOP, ed aggiunge le coroutine.

Parliamo quindi diffusamente di Tcl, un linuaggio che ho sempre trascurato perché mi sembrava macchinoso e un po’ brutto/fatto  male…ma mi sono dovuto ricredere.

Continue reading “Tool Command Language: il papa’ di Java”

iOpus | Web Browser Scripting, Web Testing, Web Scraping and Website Monitoring

iMacros – Web Automation, Web Testing and Web Scraping

Record & replay all web surfing activities

Automatically fill out web forms from a database

Automate uploads, downloads, and data extraction

iMacros is the only solution that works with websites that use Flash, Flex, Java and Silverlight

via iOpus | Web Browser Scripting, Web Testing, Web Scraping and Website Monitoring.

Suggested by a friend, it seems very complete, and the personal edition is only 50$. Try it out!

pyparsing review

This is the sad true: parsing is boring. And writing parser is even worst.

If you can choose a scripting language for parsing you can think to do it in perl.

For this way, take a big breath and go in the black sea  of perl's funny regexp. They are funny only if you have that special love for the regular expressions.

But if you are more confortable with python, pyparser is a better solution.

Pyparser is a library written in Python, for building parser described with a BNF (Backus-Naur Form).

O'Reilly has just published a "Short Cuts" e-book written by Paul McGuire; in less then 70 pages you get a very good insight of pyparser.

Even if you are new to python, the book is very easy to read.

And if you do not know nothing about parser and Backus & Naur, you will find an easy path to understand it. Parsing is a tricky topic because of the grammar theory behind it, but for all-day work, you can follow the McGuire introduction.

After some simple example, you'll dive into a small web page parser.

It is very amazing how you can do extraction from web pages without a complex Sax parser, and using only  a very compact grammar.

After this intro examples,  the manual take us to a more complex task: a lisp-like expression language parser called S-Expression.

This example is important because complex data structure are oftern recursive as S-Expression are.

The last chapter, "Search Engine in 100 Lines of Code", is a well-written example, and show us how to build a small search-engine-grammar.

 So this e-book is a "must" if you need to do even simple parsing and you… do not want to become crazy with too regular expressions :)





Advanced Bash Scripting

Is it amazing things you can do with a simple Bourne Again Shell  (bash).

I have just discovered you can open socket using a small redirection syntax, and emulate small checks you normally do with curl or wget.

The bash shell manual is always poor about examples, and this is very very sad.

In my own opinion, a good tool without a good set of examples is futile.
Crap software is still alive because is well documented.
Remember it 

(and for bash, look also  at: