Does sed -i work on AIX?
If not, how can I edit a file \"in place\" on AIX?
You can use a here construction with vi:
vi file >/dev/null 2>&1 <<@
:1,$ s/old/new/g
:wq
@
When you want to do things in the vi-edit mode, you will need an ESC.
For an ESC press CTRL-V ESC.
When you use this in a non-interactive mode, vi can complain about the TERM not set. The solution is adding export TERM=vt100 before calling vi.