for %q in (*.cgi *.pl) do ( perl -pi.bak -e"s{^#!/usr/bin/perl}{#!/usr/local/bin/perl}" "%q" )
Change for to for /r for a recursive solution.
Update: Simplified solution
In reply to Re^2: Automatically Rewrite Shebang Line on Multiple Files
by ikegami
in thread Automatically Rewrite Shebang Line on Multiple Files
by spickles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |