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

The road to LibreOffice 5.0

LibreOffice 5.0 will be announced next Wednesday – August 5, 2015 – at noon UTC. It is our tenth major release, and the first of the third stage of LibreOffice development. To show the impressive amount of new features added to LibreOffice since version 3.3, released in January 2011, we have compiled a summary of all previous announcements. Read more

Ubuntu Touch Finally Gets a Regression Fix for Nexus 4 and Aquaris Phones

Canonical has recently released a new OTA update for Ubuntu Touch and it brought a large number of new features and improvements, but also a nasty regression that caused the telephony function to fail on BQ phones and Nexus 4. That fix has finally landed. Read more

OpenDaylight dawn: Open-source software defined networking goes into production

OpenDaylight, the open-source, software-defined network, is moving from the lab into full-scale production. Read more

Battle of the sub-$450 Android phones: ZTE Axon vs OnePlus 2 vs Moto X Style

Over the past two weeks we have seen three new Android phones announced that are priced to challenge Samsung, LG, and HTC devices typically found starting at $600. Read more