How to edit a new .bashrc file in a Mac to set the python path?

1

I have been trying to open a new file .bashrc wit TextEdit on a Mac (which I am not used to work with). How to open such a new file and set the python path?

I did a touch .bashrc and a /Applications/TextEdit.app/Contents/MacOS/TextEdit .bashrc but it tells me:

The document ".bashrc" could not be opened. The file doesn't exist

So what to do? Give up the Mac and buy a decent laptop?

Addendum:

I have created an empty file named .bashrc in the home directory.

-rw-r--r--   1 adietz  10067      0 Sep 12 20:35 .bashrc 

but I cannot open it. Error see above. The file seems to exist, but the editor cannot 'see' the file? How to work with a Mac...? Is that possible?

Addendum2:

I tried the suggestions from here, but they do not work. In the TextEdit application I still do not see the file .bashrc (or any file starting with a dot)...

Alex

Posted 2017-09-12T18:23:21.843

Reputation: 337

Answers

1

To open the files directly from TextEdit, you'll need to enable Finder to "View Hidden Files". There are many ways to do this, but the easiest way is probably to press cmd+shift+dot when viewing the open file dialog in TextEdit (or Finder, or any other editor).

Another method would be to open Terminal.app, then do "open -a TextEdit .bashrc". Or use vim or another text editor from the command line.

There is also some useful information here on setting environment variables on a mac: https://www.cyberciti.biz/faq/appleosx-bash-unix-change-set-path-environment-variable/

And this site has a pretty good howto on different ways to view hidden files on a mac: http://www.macworld.co.uk/how-to/mac-software/how-show-hidden-files-library-folder-mac-3520878/

Jed Daniels

Posted 2017-09-12T18:23:21.843

Reputation: 1 166