Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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)

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.