Posts categorized under: Shell Coding

Capturing `stderr` during Fish's Command Substitution

I've been working on extending Spack's fish-shell support, and I came across an unusual problem in fish: when I use a nested version of command substitution (ie. the braces-operator (cmd)), the outer command Substitution refused to capture stderr. This can be demonstrated using the (rather dumb) following example:

function cause_error …