Skip to content

Commit bcd9073

Browse files
authored
Add note regarding alias behavior for spacktivate in non-interactive shells (#423)
1 parent b113018 commit bcd9073

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tutorial_environments.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,20 @@ command:
9393
.. literalinclude:: outputs/environments/env-activate-1.out
9494
:language: console
9595

96-
97-
You can also use the ``spacktivate`` alias for short.
98-
9996
.. note::
10097
If you use the ``-p`` option for ``spack env activate``, Spack
10198
will prepend the environment name to the prompt. This is a handy
10299
way to be reminded if and which environment you are in.
103100

101+
You can also use the shorter ``spacktivate`` alias for ``spack env activate``.
102+
103+
.. note::
104+
Alias behavior may vary depending on the shell interpreter used. In Bash,
105+
use of aliases requires the shell option ``expand_aliases`` to be set.
106+
This option is set by default, but it is not set in non-interactive shells,
107+
e.g., when executing a Bash script. In a Bash script, ``expand_aliases``
108+
can be set with the command ``shopt -s expand_aliases``.
109+
104110

105111
Once you activate an environment, ``spack find`` only shows what is
106112
in the current environment. We just created this environment, so it

0 commit comments

Comments
 (0)