sed not working on AIX in ksh shell!

Hi All,

I have this script which doesn't work on AIX ksh shell..

# ! /usr/bin/ksh

grep -irl "6000" /home/applmgr/xyz > file_list_port.log
xargs sed -i 's/6000/6010/g' < file_list_port.log

But this same script has worked perfectly on linux bash shell..

Could anyone please share experience on this issue..

An early response would be appreciated..

Thanks for your time!

Regards,

Your sed version doesn't support the -i option. Use a temporary file instead:

sed '<commands>' file > temp_file

mv temp_file file

Regards

i think only AIX 6 version support sed -i (i am not sure)
anything below that version sed -i won't work thats sure...

Hi franklin,

How do I use temporary file in my script in AIX:

grep -irl "6000" /home/applmgr/xyz > file_list_port.log
xargs sed -i 's/6000/6010/g' < file_list_port.log

Regards,

Something like:

sed -i 's/6000/6010/g' < file_list_port.log > temp.log
mv temp.log file_list_port.log

Regards