perl -pi.bak -e'BEGIN{$testname="whatever"} s!([^/]+\.data)\b!$testname/$1!g' output.txt That will make the substitutions into output.txt which is backed up in a file called output.txt.bak.
[Update: edited for thinko, VSarkiss++]
After Compline,
Zaxo
In reply to Re: how to replace ocurence of string with other string
by Zaxo
in thread ho w to replace a occurence of string by other string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |