Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just wanted to be able to add inside some fish configuration file (don't know which/where) the same function as this:

export PERL5LIB=/home/iaco/workspace/perl:/home/iaco/devtools

This line was added inside the .bashrc file and it was able to export the variable each time I opened a terminal.

Is there something like that for fish? I know that I can export variables in fish using the "set" command, but I want to modify one file (don't know which one) in order to automatically add those variables each time I open a fish terminal.

Thanks for your time!

share|improve this question

1 Answer

up vote 6 down vote accepted

You can put the user-specific fish configuration, including set directives, in ~/.config/fish/config.fish. The contents should look more or less like that

set -x PERL5LIB /home/iaco/workspace/perl:/home/iaco/devtools

More information can be found in the documentation.

share|improve this answer
Thanks Adam. The main purpose of this change is to be able to include inside the Perl @inc the path of my local libraries. After added the line you suggested, the export was properly made! But, if I run perl -V I won't see the new paths. I know that this is more a Perl question than a fish one, but I just wanted to know if you (or somebody else) have an idea – user13748 Apr 6 '11 at 23:38
I should've mentioned the -x flag. I've just updated the answer, and you can read more about that in the section "Exporting variables" in the documentation. – Adam Byrtek Apr 7 '11 at 16:58
1  
The main fish site is down, but the documentation from the fishfish fork is at ridiculousfish.com/shell/user_doc/html/commands.html#set (I assume it's the same). – Daniel James Sep 14 '12 at 11:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.