How can I make a shell script using Perl?
1 answer
The first line should be #!/bin/sh
, not #!/usr/local/bin/perl
. You are mistaken that this is a Perl script; it is a shell script that calls Perl.
It won't work either, because $ search and $ replace won't be interpolated inside single quotes. Try single quotes inside double quotes.
Or better yet, try my bulk search / replace Perl script . I keep a pure-Perl script for this because, as dangerous as bulk search / replace, you don't need multiple levels of interpretation of the shell meta-character, taking it from dangerous to completely deadly.
+10
a source to share