-
-
Save darthlukan/0af0152749d67b88422e3e768bb2e732 to your computer and use it in GitHub Desktop.
Shell change directory
This file contains 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
## script.sh | |
#!/bin/sh | |
$DESIRED_DIR="~/foo" | |
cd $DESIRED_DIR | |
## END script.sh | |
## .bashrc || .zshrc || .profile || .zprofile | |
alias mycd=". ~/bin/script.sh" | |
## END .*rc | |
## In shell | |
$ pwd | |
>> ~/ | |
$ mycd | |
$ pwd | |
>> ~/foo | |
## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment