diff options
author | June McEnroe <june@causal.agency> | 2019-01-11 00:13:22 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-01-11 00:13:22 -0500 |
commit | 7bcd786e3dd7a5e2c064a1fd0dcb68cf0506ca2f (patch) | |
tree | 6117d250e64f8fefaf356c6b606463eebfaa0a1d /bin | |
parent | Add "blank" lines to cash.1 (diff) | |
download | src-7bcd786e3dd7a5e2c064a1fd0dcb68cf0506ca2f.tar.gz src-7bcd786e3dd7a5e2c064a1fd0dcb68cf0506ca2f.zip |
Set default ENV to ~/.config/cash/cashrc
Diffstat (limited to '')
-rw-r--r-- | bin/cash/cash.1 | 12 | ||||
-rw-r--r-- | bin/cash/var.c | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/bin/cash/cash.1 b/bin/cash/cash.1 index b0cbdee0..896d1617 100644 --- a/bin/cash/cash.1 +++ b/bin/cash/cash.1 @@ -138,17 +138,11 @@ at login time in the file, and commands that are executed for every shell inside the .Ev ENV file. -The user can set the +The default value of .Ev ENV -variable to some file by placing the following line in the file -.Pa .profile -in the home directory, -substituting for -.Pa .cashrc -the filename desired: -. +is: .Pp -.Dl "ENV=$HOME/.cashrc; export ENV" +.Dl "ENV=${XDG_CONFIG_HOME:-${HOME}/.config}/cash/cashrc" . .Pp The first non-option argument specified on the command line diff --git a/bin/cash/var.c b/bin/cash/var.c index 6797efdb..54663914 100644 --- a/bin/cash/var.c +++ b/bin/cash/var.c @@ -88,6 +88,7 @@ struct varinit { struct var vhistsize; struct var vterm; #endif +struct var venv; struct var vifs; struct var vmail; struct var vmpath; @@ -104,6 +105,7 @@ struct localvar *localvars; int forcelocal; static const struct varinit varinit[] = { + { &venv, 0, "ENV=${XDG_CONFIG_HOME:-${HOME}/.config}/cash/cashrc", NULL }, #ifndef NO_HISTORY { &vhistsize, VUNSET, "HISTSIZE=", sethistsize }, |