#!/bin/bash # Script for stripping traces of the bundled mpmath library # 2011-10-12 Jussi Lehtola # Loop for i in `find . -name \*.py`; do if [[ " `grep sympy.mpmath $i`" != " " ]]; then echo $i cp -a $i $i.mpmath sed -i 's|sympy.mpmath|mpmath|g' $i fi if [[ " `grep 'from sympy import mpmath' $i`" != " " ]]; then if [ ! -f $i.mpmath ]; then echo $i cp -a $i $i.mpmath fi sed -i 's|from sympy import mpmath|import mpmath|g' $i fi done