Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- User:/$ mkdir -g foo
- User:/foo/$
- mkdir() {
- if "$1" -eq "-g"
- mkdir "$2"
- cd "$2"
- else
- ## do the regular code
- fi
- }
- mkcd() {
- if "$1" -eq "-g"
- mkdir "$2"
- cd "$2"
- else
- ## do the regular code
- fi
- }
- mkdir () {
- local do_cd=
- if [ "$1" = "-g"]; then
- do_cd=1
- shift
- fi
- command mkdir "$@" &&
- if [ -n "$do_cd" ]; then
- eval "cd "${$#}""
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement