Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Shell scripting
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="badmuthahubbard" data-source="post: 253967" data-attributes="member: 18748"><p>I want to put my program in a folder with some other stuff, including a .command file that will run the programming environment my program uses, tell it to open my program, and send it some flags.</p><p>I would like to set up the .command file so that it knows the path from which the commandline is called; ie, the path to the command file itself, so that a user can put this folder anywhere they like and be able to run it.</p><p></p><p>I also can't get the commandline to pass flags to the programming environment executable. This is the commandline I'm using, that should work:</p><p></p><p>####</p><p>#! /bin/sh</p><p></p><p>../Shared/Documents/CSHJr/JIsequencershare/Pd-0.39-2.app/Contents/MacOS/Pd -font 36</p><p>####</p><p></p><p>Now if I just take off the -font flag, it opens Pd fine. But like this, it says:</p><p></p><p>=========</p><p>Last login: Fri Sep 8 13:51:57 on ttyp1</p><p>/Users/Shared/Documents/CSHJr/JIsequencershare/JI.command; exit</p><p>Welcome to Darwin!</p><p>AC-T1212-M13:~ student$ /Users/Shared/Documents/CSHJr/JIsequencershare/JI.command; exit</p><p>retrying connect...</p><p>retrying connect...</p><p>retrying connect...</p><p>retrying connect...</p><p>retrying connect...</p><p>retrying connect...</p><p>retrying connect...</p><p>retrying connect...</p><p>retrying connect...</p><p>connecting stream socket: Invalid argument (22)</p><p>logout</p><p>[Process completed]</p><p>==========</p><p></p><p>I checked out the open, exec, and chflag commands, none of them seem to help. I would also like to replace that huge path to the executable with some sort of environment variable giving the path to where the command is called from.</p><p></p><p>Are either of these requests possible?</p></blockquote><p></p>
[QUOTE="badmuthahubbard, post: 253967, member: 18748"] I want to put my program in a folder with some other stuff, including a .command file that will run the programming environment my program uses, tell it to open my program, and send it some flags. I would like to set up the .command file so that it knows the path from which the commandline is called; ie, the path to the command file itself, so that a user can put this folder anywhere they like and be able to run it. I also can't get the commandline to pass flags to the programming environment executable. This is the commandline I'm using, that should work: #### #! /bin/sh ../Shared/Documents/CSHJr/JIsequencershare/Pd-0.39-2.app/Contents/MacOS/Pd -font 36 #### Now if I just take off the -font flag, it opens Pd fine. But like this, it says: ========= Last login: Fri Sep 8 13:51:57 on ttyp1 /Users/Shared/Documents/CSHJr/JIsequencershare/JI.command; exit Welcome to Darwin! AC-T1212-M13:~ student$ /Users/Shared/Documents/CSHJr/JIsequencershare/JI.command; exit retrying connect... retrying connect... retrying connect... retrying connect... retrying connect... retrying connect... retrying connect... retrying connect... retrying connect... connecting stream socket: Invalid argument (22) logout [Process completed] ========== I checked out the open, exec, and chflag commands, none of them seem to help. I would also like to replace that huge path to the executable with some sort of environment variable giving the path to where the command is called from. Are either of these requests possible? [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Shell scripting
Top