首页 > 解决方案 > OPAM:我可以在不同的 shell 中同时在不同的交换机上工作吗?

问题描述

这个问题在 OPAM FAQ [1] 中得到解决,但提供的两种解决方案都不适用于 OPAM v.1.2.2,因为envexec命令都是未知的。如何从不同的交换机运行单个命令?

[1] https://opam.ocaml.org/doc/2.0/FAQ.html#Can-I-work-on-different-switches-at-the-same-time-in-different-shells

标签: opam

解决方案


您链接到 opam 2.0 的常见问题解答。这是 opam 1.2:https ://opam.ocaml.org/doc/FAQ.html#Can-I-work-on-different-switches-at-the-same-time-in-different-shells

我可以在不同的 shell 中同时在不同的开关上工作吗?

是的。使用以下之一:

eval $(opam config env --switch <switch>)        # for the current
shell opam config exec --switch <switch> -- <command>  # for one command

这只会影响环境。


推荐阅读