I've been trying do put together a function that combines mkdir and cd. This is what I've been using:
#!/bin/bash
mk(){
mkdir "$1" && cd "$1"
}
mk $1
However, when I run the script using ./mker.sh test
, it'll create a directory with but won't change into it. I'm brand new to Bash so I'm really at a loss as to why that part doesn't work. It doesn't return an error to the command line either.
What's the issue here? Thanks!