Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # utility function which is used to create and change
- # to the given directory name
- # Add to the .bashrc file
- # usage:
- # mkcd directory_name
- mkcd() {
- local directory_name="${1}"
- if [ -z $directory_name ]
- then
- echo "Pass the directory name as the argument!!!" > /dev/stderr
- elif [ -d "${directory_name}" ]
- then
- cd $directory_name
- unset directory_name
- else
- mkdir -p $directory_name
- cd $directory_name
- unset directory_name
- fi
- }
Add Comment
Please, Sign In to add comment