How do I make this an alias?

I installed bat and gave it a try. Here’s some info that might help.
I got the same result. Worked directly from the command line but permission denied as an alias.

However, I tried it in Fish Shell and it works. Aliases in Fish Shell are actually functions. So that got me looking.
From my understanding zsh and bash alias are a bit more limiting than other shells

https://scriptingosx.com/2017/05/configuring-bash-with-aliases-and-functions/

So you need to create a function instead of an alias

function last2() {
	bat $(find ~/.updates/  -print | tail -n2)
}
4 Likes