On Thu, May 15, 2014 at 3:10 AM, Chris Knipe <sav...@savage.za.org> wrote:

> I'm having a bit of a strange issue executing a system command through
> perl.
> The system command reads a bunch of parameters through STDIN, and responds
> via STDOUT.  The problem is that special commands (notably the "#" and "!"
> character.  Perl itself, escapes the characters correctly (as indicated
> through the print $RADCommand code), but the command once executed through
> the shell, but from there it goes pear shaped once the system executes the
> command..
>
> A quick example:
> use Data::Dumper;
> use strict;
> use warnings;
> my $AuthName = "user\@domain.com";
> my $AuthPass = "!\@#bsay0nd";
>

Try escaping the "#" for the shell, like this: my $AuthPass =
"!\@\\#bsay0nd"; The shell sees the "#" and treats the rest of the line
like a comment. When passing "!@\#bsay0nd" to the shell, it interprets "#"
as a literal character instead.

-- 
Robert Wohlfarth

Reply via email to