On Mon, 18 Dec 2017, Sven Schreiber wrote:
Am 18.12.2017 um 09:17 schrieb Riccardo (Jack) Lucchetti:
> 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 a
Ahem, could it be you're talking about the == thing here? The current (or
future) problem was the 'sprintf' command.
Ah, ok, sorry.
I think the following could be a base for automatic sanitizing of sprintf
<bash>
# converts sprintf commands into sprintf functions
sed $1 -e 's/sprintf \([A-Za-z_0-9]*\) \(.*\)/string \1 = sprintf(\2)/'
</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
-------------------------------------------------------