Language Selection

English French German Italian Portuguese Spanish

With iterpipes, python is ready to replace bash for scripting. Really.

Filed under
Software

This has been a pet peeve of mine for years: programming shell scripts suck. They are ugly and error prone. The only reason why we still do it? There is no real replacement.

Or at least that was the case, until today I met iterpipes at python.reddit.com

Iterpipes is "A library for running shell pipelines using shell-like syntax" and guess what? It's brilliant.

Here's an example from its PYPI page:

# Total lines in *.py files under /path/to/dir,
# use safe shell parameters formatting:

>>> total = cmd(
... 'find {} -name {} -print0 | xargs -0 wc -l | tail -1 | awk {}',
... '/path/to/dir', '\*.py', '{print $1}')
>>> run(total | strip() | join | int)
315

Here's how that would look in shell:




More in Tux Machines

FFmpeg 3.2.2 "Hypatia" Open-Source Multimedia Framework Released with 30 Fixes

Today, December 6, 2016, the development team behind the powerful, open-source, free, and cross-platform FFmpeg multimedia framework released a new maintenance update in the FFmpeg 3.2 "Hypatia" series. Read more

Ubuntu-Based BackBox Linux 4.7 Is Out with Kernel 4.4 LTS, Updated Hacking Tools

On December 6, 2016, the developers behind the Ubuntu-based, hacking-oriented BlackBox Linux operating system proudly announced the release of BackBox Linux 4.7. Read more

Doyodo RetroEngine Sigma is a Linux-powered classic video game emulation console

The Nintendo NES Classic is quite an amazing console. True, it is not as powerful as modern game systems like Xbox One and PlayStation 4, but it comes pre-loaded with many classic NES titles. Unfortunately, its strength is also its weakness -- those pre-loaded titles are the only games you can play. You cannot load other games, so you are stuck with what you got. Read more

LibreOffice 5.3 Beta 2 to Land Soon as Third Bug Hunting Event Is Held This Week

Today, December 6, 2016, The Document Foundation, through Italo Vignoli, was proud to announce the upcoming third bug hunting session for the LibreOffice 5.3 open-source office suite. Read more