The error is telling you exactly what the problem is, your final terminator is missing (because you've quoted it). To save you all that backwhacking, consider using qq:

$ssh->cmd( qq{mysqldump -uroot -pnew-password -t -T/var/lib/mysql free ExData --fields-enclosed-by=" --fields-terminated-by=|} );

Read 'perldoc perlop' for more information on qq.

Depending on how Net::SSH::Perl handles the argument to cmd, you may still need to quote the double quote and pipe symbols:

$ssh->cmd( qq{mysqldump -uroot -pnew-password -t -T/var/lib/mysql free ExData --fields-enclosed-by='"' --fields-terminated-by='|'} );

Cheers,
Michael

On 05/10/2012 11:32 AM, Alvin Ramos wrote:
Have a simple perl script that will run a mysql dump, but I'm getting

Can't find string terminator '"' anywhere before EOF at ./ssh.pl line 5

My code, I assume the " is throwing it all off, but the / didn't help:

use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new("heaven.theflux.net");
     $ssh->login("root", "temp");
     $ssh->cmd("mysqldump -uroot -pnew-password -t -T/var/lib/mysql free
ExData --fields-enclosed-by=\"\ --fields-terminated-by=\|\");

Thank you for any and all assistance!

Regards,
Al


--
Michael Brader
Senior Software Engineer - Billing
Techops - Softdev
Internode http://www.internode.on.net/


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to