Pass args to command

i have a simple bash script (on Mac)

ssh $1@$2

saved as myscript.command

if i use this in terminal: /Users/mw/myscript.command admin
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"

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

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 (, 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@"”’ -e ‘end tell’”)