Need some help with Bash

Joined
Oct 30, 2010
Messages
273
Reaction score
0
Points
16
Location
Southern Illinois
Your Mac's Specs
MBP 15" I7 first one and loving it.
Ok. I'm wanting to learn some bash scripting. Found a good tutorial that I'm working through. I set up a dir to store programs bash files in. ~/Bash_Study/Programing_Study. I know that is a bit long in the tooth. So I wanted to add this location to my $PATH so I would not have to type out the path to run the files. I was able to use the export command to send the path location to $PATH. This works until you log out and back in then the setting is gone.

This is where the fun begins. So I think well just edit the path file to keep the setting after log off. From out of the past I thought that the path was in a file .profile or .bashrc. So I look for these files and can not find them anywhere. Nor can I find any file that I can edit the PATH setting. So where the **** is it?

Some one told me to try echo 'export PATH=/path/to/some/dir:$PATH' >> .profile to create the .profile file and fill it with the path statement. In my case this would have been echo 'export PATH=~/:$PATH >> .profile. After doing this I would get errors when restarting terminal. I tried to edit .profile with pico. Still did not work.

Anyone know how to do advise me what I'm doing wrong ?

Thanks
 
OP
V
Joined
Oct 30, 2010
Messages
273
Reaction score
0
Points
16
Location
Southern Illinois
Your Mac's Specs
MBP 15" I7 first one and loving it.
Ok with some searching I think I found the answer. May not be the only answer but it seems to work. If you go to /etc folder there is a file called paths. You can edit paths with sudo. I added the ~/Bash_Study/Program_Examples to the end of the file. It works! Also when I run echo $PATH the path is listed.

Problem solved.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top