Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Making Global Commands

Making Global Commands
Thread Tools
Fresh-Faced Recruit
Join Date: Jun 2007
Status: Offline
Reply With Quote
Jun 21, 2007, 09:58 AM
 
I wrote my own program, let's call it compute_sum.out It is written in Fortran 90 and is run in the terminal window with the following command prompt
>> ./compute_sum.out FILENAME

where FILENAME is the name of an input file. What I would like is to be able to use this program in any directory without having to copy the program to each directory. So what I'm saying is, I'd like ./compute_sum.out to always work in the terminal window. I know this is possible to do, anyone know how?
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jun 21, 2007, 10:02 AM
 
Copy it into your /usr/bin folder.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Jun 22, 2007, 01:22 AM
 
or create a file ~/.bashrc and add a line as so:
[codex]export PATH=$PATH:/path/to/container/of/program[/codex]
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jun 22, 2007, 01:41 AM
 
Eh, you can do that, but adding arbitrary directories to your PATH is generally more fragile and less secure.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:33 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2