I've just found out that ZSH's modifiers only work in interactive scripts, so the following will work correctly on the command line but not from a script (the script ignores the modifier and echoes the whole path).
for file in ~/folder/*; do
echo ${file:t}
done
How can I manipulate parameters in this way from an executed script file?
source
command from a.zshrc
file would be interpreted usingzsh
. When I add the shebang it all works as expected, my bad. Add it as an answer and I'll accept it!