How do I write this as an alias?
p() {
DIR=~/projects/$@
pushd "$DIR"
}
This is as far as I got, but it's piping stdin to pushd instead of xargs:
alias p="xargs printf ~/projects/%s | pushd"
It's probably better as a function, but I feel like I would learn something by knowing how to write it on one line and get the piping correct.