0

script abc.sh is on machine M1 and xyz.sh is on machine M2

script abc.sh:

#!/bin/bash
ssh -l user1 host.com ./xyz.sh -b1 arg1 -b2 arg2

script xyz has certain user prompts like pwd etc

When I execute script bc.sh from machine M1, it keeps looping with the xyz.sh script's user prompt on the terminal. It doesn't stop for user input.

Below is what I am trying to execute:

./abc.sh -a1 arg1 -a2 arg2

David Makogon
  • 2,767
  • 1
  • 19
  • 29

1 Answers1

1

ssh isn't allocating a tty. Add -t to the ssh command.

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47