Использование разных файлов .cshrc.user

1770
Baz

У меня есть два .cshrc.userфайла для двух разных проектов. Например, они устанавливают одинаковые переменные среды, но с разными значениями.

Когда я в настоящее время переключаюсь между проектами, я запускаю скрипт python, который копирует нужный .cshrc.userфайл в мою домашнюю папку, прежде чем открывать новое окно терминала.

Есть ли более удобный способ сделать это?

1

1 ответ на вопрос

0
Cairnarvon

You can specify an rc file for csh to invoke after the usual ones (that is, /etc/csh. and $HOME/{.cshrc,.login}) with the -m flag. You could keep all the shared configuration in .cshrc and move the project-specific things to their own rc files, and just start a new csh session from within your existing one whenever you want to work on your project like so:

exec csh -m .cshrc.project1 

This has the added advantage that project-specific variables don't get in the way during your regular shell use. The downside is that you'll need to do this in every new terminal window. How much of a pain that is depends on your workflow.

Похожие вопросы