On Sun, 17 Dec 2017, Allin Cottrell wrote:
The second priority is then to future-proof function packages by
ensuring that they use the currently recommended form -- and in that
context, I agree, some "shell magic" would be helpful.
A proper implementation would have to use our internal tokenizer, but for
a rough check this bash fragment may come in useful (it only catches "if"s
and you do get quite a lot of false positives, but hey)
<bash>
function chk {
FILE=$1
cat -n $FILE | grep "if " | grep '=' | grep -v -e
"[!<>=]=" > /tmp/xxx
if [ -s /tmp/xxx ]; then
echo "--- $FILE"
sed /tmp/xxx -e 's/^/\t/'
# else
# echo "--- $FILE ok"
fi
}
for f in $(find . -name "*.inp") ; do chk "$f"; done
</bash>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------