Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  Problem with Execute SSH Command

    Posted 06/28/21 08:19 AM
    Hello,

    After configuring ssh login command and executing  {ls and pwd} commands by the use of execute ssh command every thing works fine , but for " cd home/{some file path}" and using {ls} again it shows me that i am still in the first path which is home  , what may cause this problem ?

    ------------------------------
    [ahmed] [shaheen]
    [System developer]
    [valleysoft-eg]
    [Cairo] [Egypt]
    [+20-01015699307]
    ------------------------------


  • 2.  RE: Problem with Execute SSH Command

    Posted 06/30/21 01:13 PM
    Please share your script, removing confidential information, so others can take a look and help

    ------------------------------
    Joba Diniz
    ------------------------------



  • 3.  RE: Problem with Execute SSH Command

    Posted 07/01/21 09:14 AM
    Edited by Stephanie Wilkerson 07/01/21 10:04 AM
    The executeSSH command is stateless. So every time it is run it goes back to the home directory as if it were a new session.
    You can pass both commands on a single line by separating with && e.g. cd home/{some file path} && ls .
    But if run separately the state always goes back to the home directory.
    If you want just to list the content of a specific folder, you can pass the folder path as a parameter for the ls command. e.g. ls /home/{some file path}

    If you want to keep the state you can use the terminal commands:

    terminalSshConnect --name terminal1 --host "x.x.x.x" --username root --password "*******" --port 22 --timeout "00:01:00" connected=value
    terminalDetectPrompt --timeout "00:01:00" prompts=value
    terminalExecute --command "cd /" result1=value
    terminalExecute --command pwd result2=value
    terminalExecute --command ls result3=value
    terminalDisconnect --name terminal1 disconnected=value

    ------------------------------
    Jadiel Alves Barbosa
    ------------------------------