perl -pwe '$^I = ".bak"; s/[<>]/|/g' file1 perl -pwe 'BEGIN { $^I = ".bak" } s/[<>]/|/g' file2