mirror of
https://github.com/notwa/rc
synced 2024-11-09 15:39: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
|
||||
|
||||
# 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/shrc" ] || mkdir "$XDG_CACHE_HOME/shrc"; } &&
|
||||
cache="$XDG_CACHE_HOME/shrc/$sh-$$" &&
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# FAKE_COMPAT
|
||||
|
||||
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
|
||||
(ash) SH=ASH;;
|
||||
(bash) SH=BASH;;
|
||||
|
|
Loading…
Reference in a new issue