Skip to content

Instantly share code, notes, and snippets.

@SwiftyWang
SwiftyWang / config.fish
Last active October 31, 2018 02:45 — forked from overtrue/init.fish
vi ~/.config/fish/config.fish set environment variables from bash_profile after changed use source ~/.config/fish/config.fish
# Fish shell
egrep "^export " ~/.bash_profile | while read e
set var (echo $e | sed -E "s/^export ([a-zA-Z_]+)=(.*)\$/\1/")
set value (echo $e | sed -E "s/^export ([a-zA-Z_]+)=(.*)\$/\2/")
# remove surrounding quotes if existing
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
if test $var = "PATH"
@SwiftyWang
SwiftyWang / config.fish
Created April 12, 2018 02:59 — forked from overtrue/init.fish
config.fish set environment variables from bash_profile
# Fish shell
egrep "^export " ~/.bash_profile | while read e
set var (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\1/")
set value (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\2/")
# remove surrounding quotes if existing
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
if test $var = "PATH"