Linux命令:Conda激活|猫myfilename.txt
我正在学习Linux命令,并尝试在日常软件开发中更多地使用它。
我创建了一个conda
环境,并将环境路径存储在txt
文件中。 IE myfile.txt
。下次,我不需要记住激活环境的路径。它将是conda激活环境_path
我也希望不打开txt
文件以复制过去并在一行中完成激活。所以我尝试了conda激活| cat myfilename.txt
,
但它不起作用。我不确定怎么了。感谢您的一些帮助,谢谢!
I am learning Linux commands and try to use it more in my day to day software development.
I created a conda
environment and stored the environment path in a txt
file. i.e. myfile.txt
. For the next time, I don't need to remember the path to activate the environment. It would be conda activate environment_path
I also want not to open the txt
file to copy past and get the activation done in one line. So I tried conda activate | cat myFileName.txt
But it didn't work. I'm not sure what was wrong. Some helps are appreciated, thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您正在运行标准
bash
-shell。您目前正在做的事情是管道上的管道
conda conda Activate的输出/代码>
CAT MyFilename.txt
。尝试使用此命令,
首先将执行命令
cat myfilename.txt
,因此使用子壳。之后,命令
conda激活
以cat myfilename.txt
的输出运行。有关更多信息,请参见
I suppose you are running a standard
bash
-shell.What you are currently doing, is pipelining the output of
conda activate
tocat myFileName.txt
.Try instead this command
This will first execute the command
cat myFileName.txt
and therefore read the content ofmyFileName.txt
, using a subshell.After that, the command
conda activate
is run with the output ofcat myFileName.txt
in place.For more information see Command Substitution