#!/usr/bin/perl -w my @files=`ls vim-views/ | grep view`; my $cwd=`pwd`; chomp($cwd); $cwd=~s!(.*?)/VBS!$1!; print $cwd; chdir("vim-views"); foreach my $file (@files) { chomp($file); system("mv", "$file", "$file.bak"); open(IN,"<$file.bak"); open(OUT, ">$file"); while() { s!(edit\s).*?(/VBS.*)!$1$cwd$2!; print OUT; } close(IN); close(OUT); }