Question: During the startup of a Linux AMI, I would like to download some data (like the sun java libraries and some proprietary software) from an S3 bucket while initializing my EC2 connection. I notice that one way to do this is to use s3cmd. BUT, how do I get the configuration file for s3cmd .s3cfg from S3?

Also, let me also know if there is a better way to connect to S3 storage during init.

Thanks!

Answer: 
To build upon what @mob said, I think this is an escaping issue.
He's escaping too much, though. What you need is something like this:

```
my $results = `awk 'tolower(\$0) ~ $sanitized_query' *_Codes.txt`;

```

You want `$0` to be literal, but `$sanitized_query` to be interpolated. (In your code example above, you're escaping the wrong one).
Pure Perl solution, including splitting `$code_search`, globbing the filenames, and matching the patterns only at the beginnings of words:

```
use List::MoreUtils qw{ all };

my @words = ($code_search =~ m/\S+/g);

for my $fn (glob('*_Codes.txt')) {
    open my $f, '<', $fn || die "Can't open: $!";

    while (defined(my $line = <$f>)) {
        if (all { $line =~ m{\b\Q$_\E}is } @words) { print $line }
    }

    close $f;
}

```

If you don't want to depend on List::MoreUtils, then change the 'if' to:

```
        if (!grep { $line !~ m{\b\Q$_\E}is } @words) { print $line }

```

— a bit harder to read, but only uses perl builtins.