#!/usr/bin/env bash # # Miscellaneous scripts that don't belong elsewhere. # # Usage: # ./run.sh set -o nounset set -o pipefail set -o errexit source build/common.sh # for OIL_SYMLINKS # Python 3 stuff proc replace-print { #grep 'print >>' oil/*.py grep 'print ' {osh,core}/*.py #sed -i --regexp-extended -e 's/print (.*)/print(\1)/' {osh,core}/*.py } proc make-bin-links { # bin/ is for running with the Python interpreter. _bin/ is for running with # OVM app bundles. mkdir -p bin _bin for link in [$(OIL_SYMLINKS[@])] { ln -s -f --verbose oil.py bin/$link } for link in [$(OIL_SYMLINKS[@])] { ln -s -f --verbose oil.ovm _bin/$link } for link in [$(OPY_SYMLINKS[@])] { ln -s -f --verbose opy_.py bin/$link ln -s -f --verbose opy.ovm _bin/$link } } # Hm all of the solutions involve grep --perl or perl itself? # https://stackoverflow.com/questions/3001177/how-do-i-grep-for-all-non-ascii-characters-in-unix # Found a latin-1 character in Python-2.7.13/Lib/heapq.py. Had to add LC_ALL=C. proc grep-unicode { env LC_ALL=C grep --color='auto' --perl -n '[^\x00-\x7F]' @Argv } @Argv