mirror of
https://github.com/notwa/rc
synced 2024-11-13 20:19:03 -08:00
strip initial hyphen from login shells
This commit is contained in:
parent
83508f61ff
commit
7a3dc6f821
2 changed files with 2 additions and 2 deletions
|
@ -5,7 +5,7 @@ unset FANCY; _=: && [ -z $_ ] && FANCY=1 || FANCY=0 # detect zsh and bash
|
||||||
if [ "$FANCY" = 0 ]; then . ~/.prep; fi # handle stuff like /etc/profile and $PATH
|
if [ "$FANCY" = 0 ]; then . ~/.prep; fi # handle stuff like /etc/profile and $PATH
|
||||||
|
|
||||||
# combine and load everything containing "YES_MYSHELL" in ~/sh/:
|
# combine and load everything containing "YES_MYSHELL" in ~/sh/:
|
||||||
[ -z "${0##/*}" ] && sh=zsh || sh="$0" # zsh replaces $0, so hardcode it
|
[ -z "${0##/*}" ] && sh=zsh || sh="${0#-}" # zsh replaces $0, so hardcode it
|
||||||
{ [ -d "${XDG_CACHE_HOME:="$HOME/.cache"}" ] || mkdir "$XDG_CACHE_HOME"; } &&
|
{ [ -d "${XDG_CACHE_HOME:="$HOME/.cache"}" ] || mkdir "$XDG_CACHE_HOME"; } &&
|
||||||
{ [ -d "$XDG_CACHE_HOME/shrc" ] || mkdir "$XDG_CACHE_HOME/shrc"; } &&
|
{ [ -d "$XDG_CACHE_HOME/shrc" ] || mkdir "$XDG_CACHE_HOME/shrc"; } &&
|
||||||
cache="$XDG_CACHE_HOME/shrc/$sh-$$" &&
|
cache="$XDG_CACHE_HOME/shrc/$sh-$$" &&
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# FAKE_COMPAT
|
# FAKE_COMPAT
|
||||||
|
|
||||||
cd ~/sh && unset IFS || exit
|
cd ~/sh && unset IFS || exit
|
||||||
[ -z "${0##/*}" ] && sh=zsh || sh="$0" # zsh replaces $0, so hardcode it
|
[ -z "${0##/*}" ] && sh=zsh || sh="${0#-}" # zsh replaces $0, so hardcode it
|
||||||
case "$sh" in
|
case "$sh" in
|
||||||
(ash) SH=ASH;;
|
(ash) SH=ASH;;
|
||||||
(bash) SH=BASH;;
|
(bash) SH=BASH;;
|
||||||
|
|
Loading…
Reference in a new issue