I didn't work all the way down through your issue, but in case this helps:

The ^M character that you're seeing is the DOS/Windows line-end character.
When a DOS-style file is used on UNIX, most UNIX utilities don't expect
this character to be there, and 'hiccup' when they see it. So, in your
original message when you claimed to have translated the file from
DOS-style line-ends to UNIX-style line-ends, I would say you should go back
and revisit that since the evidence suggests that you did not do it
successfully. If you had done it successfully, those ^M's would not be
there.

---------------------------------------------------------------------------------------

Joe Veilleux
IBM/Lotus Domino Server Quality Engineering
550 King Street
Littleton MA 01460
Email: joeveill...@us.ibm.com




From:   "Yashaswi S. Kumar" <yashaswi.ku...@sanovi.com>
To:     "'Yashaswi S. Kumar'" <yashaswi.ku...@sanovi.com>, Sharon
            Lucas/Austin/IBM@IBMUS,
Cc:     staf-users@lists.sourceforge.net
Date:   03/13/2012 10:11 AM
Subject:        Re: [staf-users] How to remove ^M character while executing
            expect      script through STAF/STAX



Hi all,
I’m still facing the same issue while running expect. Please help!

Yashaswi S Kumar
Software Engineer
Sanovi Technologies Pvt. Ltd.
* yashaswi.ku...@sanovi.com
' +91 80 4076 2044
À +91 97423 89087
ý  www.sanovi.com
(Embedded image moved to file: pic06690.jpg)sanovi_logo_green_reverse

From: Yashaswi S. Kumar [mailto:yashaswi.ku...@sanovi.com]
Sent: 06 March 2012 11:15
To: 'Sharon Lucas'
Cc: 'staf-users@lists.sourceforge.net'
Subject: RE: [staf-users] How to remove ^M character while executing expect
script through STAF/STAX

Hi Sharon,
Here is the output when I run my expect script using STAF

staf local process start shell command
"/home/sanovi/WS/Automation/src/automation/testcases/scripts/create_new_session.sh
 auto yashaswi
atm /home/sanovi/WS/Automation/src/automation/testcases/config/TCList.csv"
returnstdout stderrtostdout wait
Response
--------
{
  Return Code: 1
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : spawn
scp /home/sanovi/WS/Automation/src/automation/testcases/config/TCList.csv
atmmgmt@192.168.2.236:/tmp
reverse mapping checking getaddrinfo for apptest.sanovi.com [192.168.2.236]
failed - POSSIBLE BREAK-IN ATTEMPT!
atmmgmt@192.168.2.236's password: interact: spawn id exp0 not open
    while executing
"interact"
    (file
"/home/sanovi/WS/Automation/src/automation/testcases/scripts/create_new_session.sh"
 line 38)

    }
  ]
}
I’m running the expect script on a Linux Image.

Also when I execute the same script through java Runtime() it works as
intended.

Here is my STAX Snippet

  <script>
                machines=[ '192.168.1.61' ]
                machName='192.168.1.61'

testdir='/home/sanovi/WS/Automation/src/automation/testcases/scripts'

tcList='/home/sanovi/WS/Automation/src/automation/testcases/config/TCList.csv'
        </script>
        <function name = "Automation" scope = "local">
                <sequence>
                        <process>
                                <location>machName</location>
                                <command
mode="'shell'">'%s/create_new_session.sh autotest yashaswi atm %s'%
(testdir,tcList)</command>
                                <stderr mode="'stdout'"/>
                                <stdout>'%s/UpdateSession.log' % testdir
</stdout>
                        </process>
                </sequence>
        </function>

The above script requires 4 parameters to work.
Yashaswi S Kumar
Software Engineer
Sanovi Technologies Pvt. Ltd.
* yashaswi.ku...@sanovi.com
' +91 80 4076 2044
À +91 97423 89087
ý  www.sanovi.com
(Embedded image moved to file: pic35069.jpg)sanovi_logo_green_reverse

From: Sharon Lucas [mailto:luc...@us.ibm.com]
Sent: 05 March 2012 21:00
To: Yashaswi S. Kumar
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] How to remove ^M character while executing expect
script through STAF/STAX

How are you running the expect script via STAX?  Are you running it using a
<process> element?  Please provide the STAX code that you are using to run
it,
On what operating system are you running the expect script?

Did you try running the expect script via STAF first?  Sometimes it is
easier to debug that way  For example:

STAF machine PROCESS START SHELL COMMAND "path to expect script"
RETURNSTDOUT STDERRTOSTDOUT WAIT

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:        "Yashaswi S. Kumar" <yashaswi.ku...@sanovi.com>
To:        <staf-users@lists.sourceforge.net>,
Date:        03/05/2012 09:21 AM
Subject:        [staf-users] How to remove ^M character while executing
expect        script through STAF/STAX




Hi All,
I’m running an expect script through stax which accepts the password and
creates a session.
This is the error I’m getting while I run the same ^M is getting appended
to each string. I did convert the script from dos2unix. Also the script
works fine when not included in STAX. Please help

spawn
scp /home/sanovi/WS/Automation/src/automation/testcases/config/TCList.csv
atmmgmt@192.168.2.236:/tmp^M
reverse mapping checking getaddrinfo for apptest.sanovi.com [] failed -
POSSIBLE BREAK-IN ATTEMPT!^M^M
atmmgmt@192.168.2.236's password: interact: spawn id exp0 not open
    while executing
"interact"
    (file
"/home/sanovi/WS/Automation/src/automation/testcases/scripts/create_new_session.sh"
 line 38)^M



Yashaswi S Kumar
Software Engineer
Sanovi Technologies Pvt. Ltd.
* yashaswi.ku...@sanovi.com
' +91 80 4076 2044
À +91 97423 89087
ý  www.sanovi.com
(Embedded image moved to file: pic02610.jpg)sanovi_logo_green_reverse

------------------------------------------------------------------------------

Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------

Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

<<attachment: pic06690.jpg>>

<<attachment: pic35069.jpg>>

<<attachment: pic02610.jpg>>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to