I use this a lot in my scripts - handy when you want to capture the output or execute a command in a different directory.
set output (echo captured)
echo $output
> captured
And if you wanna run a command in another dir: pushd other_dir
run_command
popd