in reply to Re^4: Unable to connect to some SFTP servers using Perl::SFTP
in thread Unable to connect to some SFTP servers using Perl::SFTP

Found a solution for the terminal to wait for user input from http://ubuntuforums.org/showthread.php?t=882185
system("gnome-terminal -x bash -c './uploader.pl $index @fields; read +-n1'");
But still I am not sure on how to fix the bracket issue.

Replies are listed 'Best First'.
Re^6: Unable to connect to some SFTP servers using Perl::SFTP
by salva (Canon) on Apr 12, 2013 at 07:56 UTC
    The brackets are being intercepting by the shell. You have to properly quote shell metacharacters... actually, as there are two shells being invoked (the one used by perl to run your command and the one you are calling explicitly), you will have to double quote your arguments.

    If you want to follow that route and need help about quoting I advice you to post a new question.

      Found a fix by using quotemeta(). Did that to all my parameters and its working. Thanks
      for($i = 0; $i <= $#fields; $i++) { $fields[$i] = quotemeta($fields[$i]); }
        Update:
        unless (fork()) { my $i; for($i = 0; $i <= $#fields; $i++) { $fields[$i] = quotemeta($fields[$i]); } #print $fields[0] ; system("gnome-terminal --title $fields[0] -x bash -c './uploader0.1.pl + $index @fields $file2send; echo Press any key to exit ...; read -n1' +"); exit(0); }