so, I have this bash script that I’d like to mkdir $1; cd $1 but after the script ends, you’re back to whatever dir you were previously in. I’ve done some searching and it seems unless you . / source the script, the cd will never work. Anyone have an idea how to not have to source the fucking script?
You can’t because when you run a shell it spawns a new shell which is isolated from your current shell.
If you don’t want to source your script every time then make it a shell function and source the file in your .zshrc or .bashrc then you can call that function directly. (Examples: https://github.com/strycore/dotfiles/bl … nctions.sh )