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

You Can Now Turn Your Old Moto G2 "Titan" Phone Into an Ubuntu Phone, Here's How

Walid Hammami managed to port UBports' Ubuntu Touch mobile operating system on the Moto G2 2014 smartphone, which features a Qualcomm MSM8226 Snapdragon 400 chip, 1GB RAM, and 8GB internal storage. As such, Moto G2 has been accepted by the UBports project as the first community supported device, and it's a well-done port with everything working just fine, including Wi-Fi, GSM, 3G, GPS, Bluetooth, SMS, Camera, Ubuntu Store, etc. Read more

OSS: IBM, Logz.io, Forbes FUD and OpenAI

Graphics: Mesa and More

Red Hat Leftovers