user2839873
user2839873

Reputation: 309

Passing arguments with "open -a Terminal"

It seems like it's a very stupid question.
I'm trying to open a bash-file with (another) Terminal inside a bash-file, providing two arguments.

Something like this:

open -a Terminal path/to/file.sh ARG1 ARG2

I tried something like that, which gives me no errors but simply doesn't provide the arguments:

open -a Terminal path/to/file.sh --args ARG1 ARG2

Can someone help me?

Upvotes: 4

Views: 2627

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207345

I think you mean this:

osascript -e 'tell application "Terminal" to do script "date +s"'

or this with arguments:

osascript -e 'tell application "Terminal" to do script "echo 'arg2' 'arg2'"'

Or this way of working may suit better:

osascript<<EOF
tell application "Terminal"
    do script "yourScript $1 $2"
end tell
EOF

Upvotes: 3

Related Questions