So I have a process that moves and renames files using multiple scripts. I want to have a script that runs all of these scripts. Firstly I SSH into my server then cd to the appropriate directory then run the script. Looks like this.
ssh [email protected]<EOF
cd ../../path/to/files/
sh script1.sh
EOF
This script1.sh then asks for a directory name for which to run the script and uses it in it's path. Once this script is complete I have another script I'd like to run on the same server, so I would modify my calling script to look like this.
ssh [email protected]<EOF
cd ../../path/to/files/
sh script1.sh
cd ../../diff/directory
sh script2.sh
EOF
This doesn't work... I guess there's an issue with STDIN using SSH in a nested script? Hope someone knows of an easy fix without changing too much.
<<EOF-- using a single angle bracket reads from the file named "EOF"