Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm writing a shell script. It will run from machine A, which will SSH into machine B and prompt the user to select a build folder. It'll then copy it to machine A, but I don't know how I can have the user select the folder to be copied?

install_master() {
  ssh -t -t $DEV_UNAME@$DEVSOURCE << EOF
  cd $BUILD_DIR
  ls

  ?? need the code which would select the folder and scp it 

  scp -r $BUILD_FOLDER $USER@$MASTER_NODE:/var/tmp
  exit
  EOF
}
share|improve this question

1 Answer 1

You could just take the folder path from the user input:

read BUILD_FOLDER

A curses file-selector that outputs the selection would be ideal, but I did not find one when I did a quick Google search. Your best bet might be a graphical SCP client like WinSCP or a linux equivalant.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.