R.L. Dane :Debian: :OpenBSD: 🍵<p>I've probably tooted about this before, but I don't know why this isn't standard.</p><p>It's just so obvious, at least to me. ;)</p><pre><code>~ $ type mcd
mcd is a function
mcd ()
{
[[ -n $1 ]] && mkdir "$1" && cd "$1"
}
</code></pre><p><a href="https://polymaths.social/tags/shell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>shell</span></a> <a href="https://polymaths.social/tags/unixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://polymaths.social/tags/shellscripting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScripting</span></a> <a href="https://polymaths.social/tags/sh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sh</span></a> <a href="https://polymaths.social/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> <a href="https://polymaths.social/tags/ksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ksh</span></a> <a href="https://polymaths.social/tags/mksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>mksh</span></a></p>