Posts by 'Luca Lanziani' – Page 2

Luca Lanziani

It's a Trap!

I do a big use of shell scripts, and many of them contain a for loop, do you know what normally happen when you press CTRL^C and the script is executing an action inside the loop?

for i in test{6..10}.com; do
    echo "pinging ${i}"; ping -c ...

Luca Lanziani

Gmail signature

For a while I had no signature on my email then I started to add a simple "Luca Lanziani" and now I have the following format:

--

Luca Lanziani - Software Engineer
e-mail : [email protected]
site : lanziani.com
skype : luca.lanziani

It is a simple html table with some inline ...

Luca Lanziani

Python - validate command line args

Ok, in the last article I've shown you a tool to write a nice command line interface, but it doesn't help you on validation.

try:
    level = int(args['--log-level'])
except ValueError:
    raise ArgsError('--log-level has to be a valid integer')

Manual validation? There is a much better way ...