What is this bash profile

MinGW bash profile

How to set up MSYS Bash initialization files

On Windows, the way you reference the initialization files used by Bash (e.g., profile, bash_profile, bashrc) is different from that on Linux.

The difference between the Windows and Linux operating systems is the file system structure, which leads to differences in the locations of bash files and the file naming conventions.

Set up MSYS Bash initialization files (e.g. profile, bash_profile, and bashrc)

1) Open the 'etc' folder in WINOS, which is located here: 'C: \ msys \ 1.0 \ etc \'. Note. You should see a 'profile' file in the 'etc' folder.

2) Save a file without a file extension (ie if you save, set the file type to '.all files') with the file name '.bash_profile' to 'C: \ msys \ 1.0 \ home \ USERNAME'. Note. There is a period as a prefix for the filename (e.g. '.bash_profile') as you would expect when installing Linux OS Bash

2) Save a file without a file extension (ie if you save, set the file type to '.all files') with the file name '.bashrc' to 'C: \ msys \ 1.0 \ home \ USERNAME'. Note. There is a period as a prefix for the filename (e.g. '.bash_profile') as you would expect when installing Linux OS Bash

4) Open the 'Profile' file in a text editor (raised text x is good). Note: The file location of 'Profile' is 'C: \ msys \ 1.0 \ etc \'.

In the 'profile' file, scroll to the line of text at the end of the file (i.e. scroll down). A test should appear on this line, stating that Bash is changing the current directory to HOME (In MSYS, HOME is as defined in profile file)

5) Copy the following code before the line with the text 'CD $ HOME'. Adding this script to 'profile' tells MSYS bash to run the bash_profile #. ---------------- ---------------------------------- ---------------- --------- #modified BEGIN

6) Open the 'bash_profile' file in a text editor (Sublime Text x is good) and open the end of the file (at the end of the file).

7) Copy the following code at the end of the file. If you put this script in ".bash_profile", it will tell Bash to run ".bashrc".

# ------------------------------------------------- --------------------------

8) OK, now let's write a little script in '.bashrc' to see if 'profile' calls 'bash_profile' and if 'bash_profile' calls '.bashrc'.

8.1) Think of a command name that you want to create. Let's use 't' as a test

8.2) Open the bash terminal and enter 't'. Bash should reply 't: command not found' - if it doesn't say 't: command not found' then repeat 8.1 and 8.2 until your command name says 'command not found'. You don't want to use an alias for a command that uses BAD! Has been assigned. So it must be "Command not found".

8.3) OK, 't' gave me a 't: command not found'. Now we write the script in '.bashrc'

8.4) Write in '.bashrc'

8.5) Save the '.bashrc' file in 'C: \ msys \ 1.0 \ home \ USERNAME'

9) Almost there. Now restart the bash terminal and close all previously opened bash terminals

10) Enter the terminal 't'. It should answer "test passed". If not, double-check that the code was written correctly (check the quotation marks first).

Some Notes 1) 'source filename' is the same as'. Filename '

2) "" double quotes allow variables to be replaced with their content, single quotes do not

3) $ HOME is / home / USERNAME like ~ is / home / USERNAME

4) A function is always preferred to alias 2

See the BASH reference for more details

I'm new to bash. So there is no guarantee that I did the best I could.

Good luck!