#!/bin/bash TEMPF="$(mktemp)" /usr/bin/time -v -o "$TEMPF" -- "$@" MAXMEMKB="$(grep "Maximum resident set size (kbytes)" "$TEMPF" | tr -cd [:digit:])" MAXMEMMB="$(python3 -c "print(f'{$MAXMEMKB / 1024:0.3f}')")" echo "$(date +"%F %H:%M:%S") $MAXMEMMB MB, $@, $(pwd)" | perl -ne "s^$HOME^~^g; print \$_;" >>~/.openscad_mem.log rm -f "$TEMPF"