You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/terminal.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,3 +76,51 @@ export PATH=$xdgbase/bin:$PATH
76
76
!!! note "XDG what?"
77
77
The [XDG base directory specification](https://specifications.freedesktop.org/basedir-spec/latest/) is used by most applications to determine where to look for configurations, and where to store data and temporary files.
78
78
79
+
[](){#ref-guides-terminal-bashrc}
80
+
## Modifying bashrc
81
+
82
+
The `~/.bashrc` in your home directory is executed __every time__ you log in, and there is no way to log in without executing it.
83
+
84
+
It is strongly recommended that customisation in `~/.bashrc` should be kept to the bare minimum:
85
+
86
+
1. It sets a fixed set of environment options every time you log in, and all downstream scripts and Slurm batch jobs might assume that these commands have run, so that later modifications to `~/.bashrc` can break workflows in ways that are difficult to debug.
87
+
* If a script or batch job requires environment modifications, implement them there.
88
+
* In other words, move the definition of environment used by a workflow to the workflow definition.
89
+
1. It makes it difficult for CSCS to provide support, because it is difficult for support staff to reproduce your environment, and it can take a lot of back and forth before we determine that the root cause of an issue is a command in `~/.bashrc`.
90
+
91
+
92
+
!!! warning "Do not call `module` in bashrc"
93
+
Calls to `module use` and `module load` in `~/.bashrc` is possible, however avoid it for the reasons above.
94
+
If there are module commands in your `~/.bashrc`, remember to provide a full copy of `~/.bashrc` with support tickets.
95
+
96
+
!!! danger "Do not call `uenv` in bashrc"
97
+
The `uenv` command is designed for creating isolated environments, and calling it in `~/.bashrc` will not work as expected.
98
+
See the [uenv docs][ref-uenv-customenv] for more information about how to create bespoke uenv environments that can be started with a single command.
99
+
100
+
??? note "Help, I broke bashrc!"
101
+
It is possible to add commands to bashrc that will stop you from being able to log in.
102
+
The author of these docs has done it more than once, after ignoring their own advice.
103
+
104
+
For example, if the command `exit` is added to `~/.bashrc` you will be logged out every time you log in.
105
+
106
+
The first thing to try is to execute a command that will back up `~/.bashrc`, and remove `~/.bashrc`:
0 commit comments