Zshell special variable for previous command's output

command-line-arguments, shell, zsh

Solution

You could just wrap `$_` in `$()` to execute it again I suppose

$ which zsh
/bin/zsh
$ echo $($_)
/bin/zsh

Not sure if there's a variable that holds that output without re-running the command though...

Problem

What is the special variable that stores that previous command's output in a zshell? For example, if I did: ``` $ which zsh something ``` Instead of copying the output 'something', is there a way to get the output by way of a special variable? I know I could use `$_` to get the previous command that was called, is there something similar?

Original source