Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use Data::Dumper;
- sub shell_quote_arg {
- my ($s) = @_;
- return $s if $s =~ /[^-\/@=_0-9a-z]/i;
- $s =~ s/'/'"'"'/g;
- return qq{'$s'}
- }
- sub shell_quote {
- return join ' ', map { shell_quote_arg($_) } @_;
- }
- print shell_quote('echo', q{He's got $100});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement