I want to open new terminal and pass some values on OSX. I tried this code:
open_new_terminals_automatically()
{
osascript -e 'tell application "Terminal" to do script "cd $1; $2"'
}
# call the function and pass arguments
open_new_terminals_automatically "/root/var/fome_path" "some_commnds -argument"
This is very simple example to explain what I want to do. How I can implement it to run as bash script on OS X.