On Mon, 27 Jul 2015, wes wrote:
> Awk is for modifying existing data.
Wes,
Yes, it's a pattern-matching language. But, it acts only on the line on
which it matches the pattern.
> 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
Good to know.
Thanks,
Rich
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug