MikeKulls has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys and Girls, I am using Expect perl module to connect to a another machine via ssh and execute some simple commands. This is working well except that if I get input via STDIN then it appears that further commands get ctrl-G appended at the end of words. As an example, the command I execute is: enable config system file-mgtn remove tag xxxx type crash-info local-file abc.log The output I get from the log is enable config system file-mgtn^G remove^G tag^G xxxx^G type^G crash-info^G local-file^G abc.pl This looks to me like random garbage but the odd thing is it comes out exactly the same every time. I think I'm doing something wrong because most of the output I get has extra /r or /n in it (it gives 3 times as many as it should). Thanks in advance for any replies. Cheers, Michael

Replies are listed 'Best First'.
Re: Expect and STDIN
by MikeKulls (Novice) on Sep 27, 2010 at 06:41 UTC
    Please ignore this question. The ctrl-Gs are added by the box I am connecting to, maybe to show color or something in some terminals. The command was just incorrect. I was assuming the ctrl-Gs were the problem, they were just the result of another problem.

      Thank you for the update that you have found the problem. You have no idea how many posters to this site would simply not have bothered.

      BTW: Since you posted under your account rather than anonymously, you could have added an Update note to the original post rather than replying to your own OP. You could even have added a request for Reapage!

        You could even have added a request for Reapage!

        Ah, no. This is a very inappropriate reason to cry reap. Problems like this, and their solutions, no matter how quickly the latter come and whether the OP answers his/her own, should remain for the benefit of future questioners.

        HTH,

        planetscape
Re: Expect and STDIN
by MidLifeXis (Monsignor) on Sep 27, 2010 at 13:58 UTC

    You have already solved this, but for the sake of others stumbling across this... ^G is historically the alert character -- it rings the bell on the terminal.

    --MidLifeXis