it has come to my attention that i could make a series of bash scripts in Terminal.app (OSX), though i am not quite sure if I should make an executable (and in case how) file (from a textdocument and then make it executable) in order to run the command and type the data needed, (password) It is supposed to open a ssh in order to throw data from a .java file (numberous doubles) to a MySQL db
what I would like to 'automate' is
sudo ssh name@ipadress
give the password and login to MySQL
use database;
I have tried to automate it but the "tell" doesn't do anything.
Is there any way I could do this without Automator.app but just by clicking a document
.
//*
tell application "Terminal"
set currentTab to do script ("sudo ssh name@ipadress")
delay 2
do script (password)
delay 2
do script (mysql) in currentTab
delay 2
do script (use [databasename]) in currentTab
end tell
*//
(NB) could i copy the script to a text-file and name it .commmand? (for later implementing in java)