Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to source a file in Fish

📅 2014-Feb-27 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ fish, source ⬩ 📚 Archive

The command to source the contents of a file in the Fish shell is the same as bash: . The documentation for this command is here.

For example, to test if a file exists and source it:

if test -e ~/.foobar
    . ~/.foobar

Tried with: Fish 2.1.0 and Ubuntu 12.04 LTS

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧