I have never done bash variable interpolation like that, so I don't know the proper syntax to get it to work. Nevertheless, assuming that you can get that part to work, the regular expression that you'll want would be this:
Code:
perl -pie 's/R1\|\d{4}\|[A-Z]*/R3/i' $filename
Therefore remove the qq{} enclosing $RUN, unless this is necessary for the variable to be interpolated, and also remove the / after that as well.
Comment