pyp is a linux command line utility for text manupulation much similar to awk sed and other unix power tools. The best is that you can use the unix pipe ‘|’ to and from the pyp command and internally use python syntax. This gives the power of python in shell.
apt-get install pyp or pip install pyp
ls *jpg 20170531_212144.jpg 20170531_212218.jpg 20170531_212227.jpg krish@code:~/work/codelectron/Sensorkit$ ls | pyp "p.replace('jpg','jpeg') " 20170531_212144.jpeg 20170531_212218.jpeg 20170531_212227.jpeg
ls | pyp "p.replace('jpg','jpeg') |p.upper()" 20170531_212144.JPEG 20170531_212218.JPEG 20170531_212227.JPEG
Pyed Pyper was developed at Sony Pictures Imageworks to facilitate the construction of complex image manipulation “one-liner” commands during visual effects work on Alice in Wonderland, Green Lantern, For more information refer to this link https://code.google.com/archive/p/pyp/