On Mon, Jul 27, 2015 at 7:55 AM, Rich Shepard <[email protected]>
wrote:
>
> Before writing such a script advice on a (or most) appropriate tool
> would
> be helpful. Would awk be the appropriate tool for this? Should be a short
> script so perhaps a linux utility would be a parsimonious working solution.
>
> Rich
>
>
Awk is for modifying existing data. You are adding completely new lines, so
the best tool for the job would be cat.
for filename in /path/to/app/source/*py
do if ! grep wxversion $filename
then echo "import wxversion
wxversion.select('3.0.2.0')
import os, time, wx" > $filename.new
cat $filename >> $filename.new
mv $filename.new $filename
fi
done
-wes
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug