I've probably tooted about this before, but I don't know why this isn't standard.

It's just so obvious, at least to me. ;)

~ $ type mcd mcd is a function mcd () { [[ -n $1 ]] && mkdir "$1" && cd "$1" }

#shell #UnixShell #ShellScripting #sh #bash #ksh #mksh

@rl_dane I also have something like this called "mkdircd" 

More gems I use a lot:
- wping()='curl -Lv "$1"' > /dev/null'
- dctl='systemctl'
- dctlu='systemctl --user' (yes I run some of my own background services + regular miantenance on systemd, bring in the pitchforks )

@Parnikkapore

Now that I think of it, using netcat would probably be a more efficient implementation of wping, such as

function portcheck { nc -zw1 "$1" "$2" &>/dev/null } function wping { local port successports=() host="${1:-}" for port in 80 443; do portcheck "$host" $port && successports+=($port) done case ${#successports[@]} in 0) echo "$host is down"; return 1;; 1) echo "$host is up (port ${successports[@]})";; *) echo "$host is up (ports ${successports[@]})";; esac }

@rl_dane wping is not a host-up checker, it's a website-up checker :D

(and, admittedly, often a "why is my internet not working" debugging tool)

@rl_dane Alternate-universe me might've taken in a variant of your function as `tcping` though