Replaces either patterns or variables inside the file or directory named by PATH.
Notes
If PATTERNS_FILE is specified, the patterns (i.e. 'from' and 'to' strings separated by a tab) are replaced inside PATH. PATH can either be a file or a directory.
If PATTERNS_FILE is not specified, variables inside PATH are replaced from environment variables (e.g. @{WORK_DIR}).
This function is useful for performing configuration replacements during installation.