This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example perl one line replacing contents in a file in place | |
perl -pi -e 's/something_to_match/replaced_with/' ./my_path/to_file.txt | |
# Additional regex modifiers got global multi-line and case insensitive | |
perl -pi -e 's/something_to_match/replaced_with/gmi' ./my_path/to_file.txt | |
# Using different delimiters for the regex, in this case using a # instead of the tranditional / | |
perl -pi -e 's#something_to_match#replaced_with#' ./my_path/to_file.txt | |
# If you don't want to modify a file in place you can split things up a bit |