# replace all occurrences in the file edit_file { s/foo/bar/gs } myfile.txt> # replace occurrences a line at a time edit_file_lines { s/foo/bar/g } myfile.txt>