Parameters in ZSH Aliases

zsh

Solution

Aliases are simply replaced by their text. Unless you can reorder the parameters of the command you are aliasing so that all parameters are at the end, aliases are not the way to go.

If you want to use parameters, functions are better suited:

function mydtach () {
    dtach -A "/tmp/$1" -r winch dvtm
}

Call with:

mydtach directoryName

Problem

I'm looking to speed up my workflow a bit by creating a `zsh` alias for dtach that would function like this: ``` dtach -A /tmp/{directoryName} -r winch dvtm ``` I've tried doing this, which does not work. ``` dtach -A /tmp/$ -r winch dvtm ``` ZSH newb here, any help would be much appreciated. Thanks!

Original source