|
|
#1 |
|
Prospect
Join Date: Apr 2010
Posts: 35
|
How to execute a binary file via command line?
Hi,
I'm using Mac 10.7.5. I'm trying to write a script to conditionally launch an application, but I can't actually figure out how to launch that application. The application lives here Code:
Daves-MacBook-Pro:~ davea$ ls -al /Users/davea/.magicJack/Softphone/magicJack.app/Contents/MacOS/magicJack -rwxr-xr-x 1 davea staff 23080080 Jan 21 13:33 /Users/davea/.magicJack/Softphone/magicJack.app/Contents/MacOS/magicJack Code:
Daves-MacBook-Pro:~ davea$ bash /Users/davea/.magicJack/Softphone/magicJack.app/Contents/MacOS/magicJack /Users/davea/.magicJack/Softphone/magicJack.app/Contents/MacOS/magicJack: /Users/davea/.magicJack/Softphone/magicJack.app/Contents/MacOS/magicJack: cannot execute binary file |
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: May 2008
Location: Down by the river
Posts: 190
|
It appears you are trying to use bash to execute a binary. Rather than:
"bash /Users/davea/.magicJack/Softphone/magicJack.app/Contents/MacOS/magicJack" just run: "/Users/davea/.magicJack/Softphone/magicJack.app/Contents/MacOS/magicJack" Without the quotes, of course. ![]() Bash will be looking for a shell script to interpret, not a binary. |
|
|
|
|
|
#3 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
|
And if you want to run this from a shell script, you could use the "system" command. Check almost any tutorial on Bash - e.g. the ones listed in the last section of this Unix FAQ
__________________
hayne.net/macosx.html |
|
|
|
|
|
#4 |
|
Prospect
Join Date: Apr 2010
Posts: 35
|
Shoot that was easy! Thanks, - Dave
|
|
|
|
|
|
#5 |
|
Hall of Famer
Join Date: Feb 2003
Location: Brighton, UK
Posts: 3,807
|
And if you want it to run periodically/automatically you should use launchd
|
|
|
|
![]() |
| Tags |
| binary file, command line, script |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|