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

NetOS Enterprise Linux 8 Promises to Be a Worthy Alternative to Chrome OS

Black Lab Software CEO Roberto J. Dohnert informs Softpedia today about the general availability of the NetOS Enterprise Developer Preview 8 operating system. Designed as a replacement for the Linux kernel-based Chrome OS or Chromium OS operating systems, Black Lab Software's upcoming NetOS distribution is using the same technologies that have been implemented in the Enterprise Edition of the Black Lab Linux OS. Read more

Gentoo Linux "Choice Edition" Live DVD Released with Kernel 4.5, ZFS on Linux

The Gentoo Linux operating system has received an updated Live DVD ISO image today, dubbed "Choice Edition," which brings the latest GNU/Linux technologies. According to the announcement, the Gentoo Linux "Choice Edition" Live DVD has been released in celebration of the continued collaboration between Gentoo developers and community. And it looks like it brings some of the latest software releases, such as the KDE Plasma 5.6 desktop environment. Read more

Android Leftovers

Red Hat News