Pass args to command

Hello,
i have a simple bash script (on Mac)

#!/bin/bash
ssh $1@$2

saved as myscript.command

if i use this in terminal: /Users/mw/myscript.command admin 10.0.0.68
it works

now i want to use xojo to open that script in terminal and pass the two arguments to that script.

but this doesn’t work:

dim s as shell
dim f as FolderItem=GetFolderItem("/Users/mw/myscript.command")

s.Execute f.ShellPath +" admin 192.168.3.40"

Note: “ssh” is just an example, i just wanted to know how this could work to open the terminal app, pass args and execute a script.

or Simple: how do i execute shell commands to run in terminal.app?

Thanks Marco

why not

dim s as shell s.execute("ssh $1@$2")

it is better to use the full path in shell
find out with

command -v ssh

thanks, but that doesn’t open the console (terminal.app), that just executes the ssh command…

Why do you want to open the Terminal? Is the Terminal AppleScriptable? Then what you want to do might work.

got it:

dim s as new shell
s.Execute(“osascript -e ‘tell application ““Terminal””’ -e Activate -e ‘do script "“ssh admin@192.168.3.40"”’ -e ‘end tell’”)