This function searches for all rmake variables in the given vector x and replaces them
with their values that are defined in the vars argument. An rmake variable is identified
by the $[VARIABLE_NAME] string.
Examples
vars <- c(SIZE='small', METHOD='abc')
replaceVariables('result-$[SIZE]-$[METHOD].csv', vars) # returns 'result-small-abc.csv'
#> [1] "result-small-abc.csv"