1

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
}
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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