Sed on AIX does not recognize -i flag

后端 未结 6 1952
闹比i
闹比i 2020-12-07 01:39

Does sed -i work on AIX?

If not, how can I edit a file \"in place\" on AIX?

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 02:39

    #!/bin/ksh
    host_name=$1
    perl -pi -e "s/#workerid#/$host_name/g" test.conf 
    

    Above will replace #workerid# to $host_name inside test.conf

提交回复
热议问题