I have a directory variable and function as follows:
coding_dir="~/Documents/coding"
function f() { cd $1 && ls -a ; }
And I want to create an alias as follows:
alias rnd="f $coding_dir/random"
But when I try using the alias, I get the following error:
f:cd: no such file or directory: /random
I am aware I could just use the entire directory in the alias, but this was working when I was using bash
. How do I get this to work in zsh
?
export coding_dir
.export
do?