- Run
sudo ln -s $HOME /Users/myshortname
- Add
profile
script to the top of your/etc/profile
- Create
~/.useralias
file with the name of your alias (myshortname in this case) - Use
$ORIG_HOME
for things like yourNVM_DIR
that doesn't like aliases
Last active
April 27, 2018 19:53
-
-
Save brysgo/70def356e3603b0bb3e75f68628fe66f to your computer and use it in GitHub Desktop.
Use alias for home directory (if username has a space)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myshortname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f "$HOME/.useralias" ]; then | |
export ORIG_USER=$USER | |
export USER=`cat "$HOME/.useralias"` | |
export ORIG_LOGNAME=$LOGNAME | |
export LOGNAME=$USER | |
export ORIG_HOME=$HOME | |
export HOME="/Users/$USER" | |
fi | |
if [ "$PWD" = "$ORIG_HOME" ]; then | |
cd ~ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment