1 2 3 #### 1 4 3 # there is an extra newline at the end, above #### for i in $(seq 1 10); do perl -i.x -lp0e 's/2/4/gs' a; done