my question seems to be general, but I cannot find the answers.
In the sed command, how can you replace the replacement pattern with the value returned by a simple bash function.
For example, I created the following function:
function parseDates(){
and the following sed command:
myCatFile=`sed -e "s/[0-3][0-9]\/[0-1][0-9]\/[0-9][0-9]/& parseDates &\}/p" myfile`
I found that caracter '&' represents the current found pattern, I would like it to be passed to my bash function, and the whole pattern should be replaced with the found pattern + dateParsed.
Does anyone have any ideas? Thanks
source share